question on using jemalloc profile for java app

Chen Song at
Mon May 23 15:25:08 PDT 2016


I started using jemalloc to profile one Java program and I had some
difficulty getting it working.

My sample Java program is very simple.

        int[][] array = new int[1 << 20][];
        for (int i = 0; i < array.length; i++) {
            array[i] = new int[1 << 10];

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.

I profiled the Java with jemalloc with the following options,


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.

My jemalloc should be installed correctly b/c I can see memory dump file
generated with the following option.

export MALLOC_CONF="prof:true,prof_final:true,prof_prefix:/tmp/jeprof.out"

Is there anything I am missing or misusing jemalloc?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the jemalloc-discuss mailing list