[LLVMdev] Module management questions

Larry Gritz lg at larrygritz.com
Mon Aug 23 10:10:06 PDT 2010

On Aug 20, 2010, at 2:30 PM, Reid Kleckner wrote:

> I would imagine that most memory is used in the IR of the functions,
> which you can delete as I described in my last message.  Did that
> help?

It helps a little, but it seems that most of the memory consumption is elsewhere.  I haven't had the time to spelunk through the Module internals enough to say for sure what's using up the memory.


On Aug 23, 2010, at 7:25 AM, Nicolas Capens wrote:

> I faced the same issue and solved it by writing my own JITMemoryManager.
> This is the class that is responsible for allocating memory for the JITed
> functions. So your derived implementation can let the application take
> ownership of this memory before destructing the entire execution engine.
> createJIT takes a JITMemoryManager as parameter, so it's straightforward to
> make it use your derived class.

Great suggestion, that sounds like what I was shooting for.  I'll give that a try.


Larry Gritz
lg at larrygritz.com

More information about the llvm-dev mailing list