Java 64 bit consumes excessive native memory (c-heap) due to JIT Compilation

Ashish Saxena anantiitrke at gmail.com
Wed Aug 22 09:26:01 PDT 2012


I doubt if this is thread local memory area, for this disappears when
moving to interpreted mode(-Xint) or static compilation mode (-Xcomp).
Moreover, this occurs when JIT Compiler tries to do optimizations
related to inlining. On disabling the inling optimizations using
-XX:-Inline   the 64 MB blocks disappears.

Moreover, why would thread local area be so large ... 64 MB when
thread stack size is usually 1 MB. Any thoughts ?


Thanks,
Ashish
> On 08/21/2012 05:29 PM, Ashish Saxena wrote:
>
>> In our Java 64 bit application, we are observing that JIT Compiler is
>> allocating about 10 anonymous blocks of  64 MB each as soon as it
>> begins compilation. Due to these extra native memory the Resident set
>> size (RSS) of the linux process goes upto 2 GB. I have xmx setting of
>> 1 GB and PermGen of 128 MB.  So, i expect the JVM Process to use
>> nearly 1GB + 128 MB + JVM ovehead = 1.2 GB   However, the value is 2
>> GB.  On looking at the pmap output, it shows that this high memory it
>> shows many 64 MB Blocks.
>> To identify the cause of these blocks, we tried different JVM JIT
>> Compiler related options. On using -Xcomp to statically compile the
>> application, RSS is 1.2 GB and only 1 anon block of 65 MB  is seen in
>> pmap output.
>> Code Cache size is around 15 MB only.  Why JIT is having so much
>> overhead ? Is it the Data Cache ? I think it is usually a subset of
>> CodeCache.
>>
>> Note: this behaviour is seen on all updates of JVM 1.6 and 1.7.
>
> If this is Linux, these are thread-local C heaps.  They are 64M in size,
> and you'll get one for each thread.
>
> Andrew.
>
>


More information about the hotspot-compiler-dev mailing list