<div dir="ltr">Hi <br clear="all"><div><br></div><div>I started using jemalloc to profile one Java program and I had some difficulty getting it working.</div><div><br></div><div>My sample Java program is very simple.</div><div><br></div><div><div><br></div><div>        int[][] array = new int[1 << 20][];</div><div>        for (int i = 0; i < array.length; i++) {</div><div>            array[i] = new int[1 << 10];</div><div>        }</div></div><div><br></div><div>What it does is to create an higher order array of size 1M, and for each slot, create an integer array of size 1K. So in total it should allocate 1M * 1K * 4 byte = 4G memory.</div><div><br></div><div>I profiled the Java with jemalloc with the following options,<br></div><div><br></div><div>export MALLOC_CONF="prof:true,lg_prof_interval:30,lg_prof_sample:10,prof_prefix:/tmp/jeprof.out"<br></div><div><br></div><div>My understanding is jemalloc should be able to dump a file each time 1G is allocated, at a sampling frequency of 1K allocation. However, I never see any dump file automatically generated.</div><div><br></div><div>My jemalloc should be installed correctly b/c I can see memory dump file generated with the following option.</div><div><br></div><div>export MALLOC_CONF="prof:true,prof_final:true,prof_prefix:/tmp/jeprof.out"</div><div><br></div><div>Is there anything I am missing or misusing jemalloc?</div><div><br></div><div>Chen</div>
</div>