[llvm-dev] Memory usage with MCJit

koffie drinker via llvm-dev llvm-dev at lists.llvm.org
Sun Jul 24 08:50:44 PDT 2016


Hi all,

I'm building a runtime that  can jit and execute code. I've followed the
kaleidoscope tutorial and had a couple of questions. Basically I have a
pre-compiler that compiles the code to cache objects. These cached objects
are then persisted  and used to reduce Jit compile time.

1. I took the approach of 1 execution engine with multiple modules (I'm not
removing modules once they have been added). During profiling, I noticed
that the memory usage is high with a lot of code. How can I reduce the
memory usage? Is one execution engine per module preferred? I would imagine
that this would take up more memory.

2. When I add a module and jit it, can I invoke a remove module and still
be able to execute the compiled function?

3. Is it better to have one runtime mem manager that will be associated
with multiple execution engines (one engine per module)? Using this
approach I could throw away the execution engines once they have jitted the
code. I probably need to take ownership of the jitted code somehow. Are
there any examples available on how this could be achieved?

cheers,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160724/b71d177a/attachment.html>


More information about the llvm-dev mailing list