Search code examples
javamemory-managementmemory-leaksgarbage-collectionjrockit

Frequent Full GC & Zero Reclaim During MInor GC


In one of my production application we are using Oracle JRockit as JVM. Minor GC Frequency is very high (approx. every 40 sec). But some time we see frequent Full GC happening and during that time Minor GC also reclaim negligible bytes. resulting in application application failure, as our application is required to response in 1sec and full GC pauses are taking more than 1 secs.

I have some observation from GC logs 1- Minor GC unable to reclaim any bytes during that period, other than particular period Minor GC reclaims almost 95-99 Percent of nursery(Except keep area). 2- I am observing Emergency parallel sweep requested During this Compaction phase

My Heap Configuration are

Heap            : 10 GB
Nursery         : 1GB
GC              : gencon
Keeparea        : 50%
CompactionRatio : 10%
gcTrigger       : 40%

We tried changing to Nursery size to 2GB & 3GB , where frequency of issue decreased with 2GB and increased with 3GB

Any help why this issue is caused or how to investigate this further

Update 1 :

I have enabled memdbg module for GC and found that Full GC is triggered because Nursery parts are higher than the default limit 10000, but I can see that OC is also leaving high number of parts in nursery. Any guidance in this matter


Solution

  • So we got it resolved, to get to the depth of the issue, we have enabled verbose memdbg module , which given us the info why GC was getting triggered. Full GC was trigerring with reason Allocation request failed, which as per Oracle documentation occurs when nursery part of heap is fragmented as they added a check from R28.2.5 to check overall parts in nursery during every minor GC and if it is more than the defined limit (default is 10K) Minor GC will be aborted and a Full GC will be triggered with reason allocation request failed.

    To resolve this we have added below parameter to disable this check, after which system is working fine.

    -XXNurseryPartsLimits=0