Reputation: 855
In JDK 1.6 : I see that full GC has been run but the old generation and perm gen space is not used completely - question is as per my understanding FGC only runs when old gen or perm gen is full - I am not able to understand why it has run even though usage % is low?.
See output of jstat -gcutil below:
S0 S1 E O P YGC YGCT FGC FGCT GCT 0.00 82.14 51.17 13.78 26.43 219 19.347 1 0.131 19.479 S0 S1 E O P YGC YGCT FGC FGCT GCT 82.14 0.00 9.12 13.92 26.66 222 19.771 1 0.131 19.902 S0 S1 E O P YGC YGCT FGC FGCT GCT 82.14 0.00 11.07 9.07 24.15 230 20.166 2 1.851 22.017
My min/max heap is 1024M and min and max permGen space is defined as 768M.
Upvotes: 4
Views: 6365
Reputation: 10938
FGC only runs when old gen or perm gen is full
It's not true. Read java reference paper here
Memory management in Java may surprise everyone. It takes many years to learn how to set JVM parameters for non-trivial applications.
permGen space is defined as 768M.
Decrease it to 128M
Upvotes: 0
Reputation: 11
Switch on the verbose gc to now exactly when the full gc has happend. Because jstat shows FGC events even for major/tenured collections
Upvotes: 1
Reputation: 855
I resolved the issue by placing the jvm opts : XX:-DisableExplicitGC
.
Some code in some external jar file may have been explicitly calling System.gc
resulting in such garbage collection behavior. Disabling these, resulted in the expected behavior of Garbage Collection running when 100% usage was about to be reached.
Upvotes: 1