[LLVMdev] JIT Leaks?

Paolo Invernizzi arathorn at fastwebnet.it
Sat Jul 14 07:39:41 PDT 2007


Hi all,

I'm playing with the JIT trying to find out the best way to handle a  
genetic algorithm that we are developing: I need to:

1) generate about 50.000 functions a time
2) JIT them and execute them over a large dataset
3) Discard everything
4) ... stuff...
5) Loop to 1 again and again and again...

I've the code running, under LLVM 2.0 on OS X 10.4.10 but it leaks,  
so I started to tweak the standard "fibonacci" example to understand  
how to do in a proper way the step 3.

- Simply deleting the execution engine instance in the fibonacci code  
and looping all the main code give me memory leaks. Can anybody  
confirm this?

- Conserving the module, the execution engine and the module  
provider, but releasing the fibonacci function with:

EE->freeMachineCodeForFunction(FibF);
FibF->eraseFromParent();

and recreating the function from scratch leaks even more. Idem,  
someone can confirm this?

Thanks in advance.
Paolo Invernizzi




More information about the llvm-dev mailing list