LLVM JIT vs Interpreter memory foot print

I want to compare the memory footprint of LLVM JIT vs the Interpreter on
I am currently doing this by running lli, on a simple but long running
program, with and without the "-force-interpreter option", and then I look
at the Real Memory used by lli in the Activity Monitor. I currently observe
that the JIT takes 4.0MB and the Interpreter takes 1.7MB.
Are these values close to what one would expect ?
Is there a better way to do this comparison ?


can you post the simple but long running program?

Hi James,

What I meant by "simple" was that it required very little memory.
Here is the program...

int main() {
  int sum = 0;
  int i,j,k,l;
  int count = 2099999990;

  for( i = 0 ; i <= count ; i++) {
    for( j = 0 ; j <= count ; j++) {
      for( k = 0 ; k <= count ; k++) {
        for( l = 0 ; l <= count ; l++) {
          sum ++;

  printf("Sum: %d\n", sum);


James Northrup-3 wrote: