4

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.

Community
  • 1
  • 1
Anna
  • 855
  • 2
  • 10
  • 26
  • One possible reason could be RMI: " RMI forces periodic full collection. The frequency of these collections can be controlled with properties.java -Dsun.rmi.dgc.client.gcInterval and -Dsun.rmi.dgc.server.gcInterval" http://java.sun.com/docs/hotspot/gc1.4.2/ – Anna Oct 19 '10 at 04:23

3 Answers3

1

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.

Akhil Jain
  • 13,872
  • 15
  • 57
  • 93
Anna
  • 855
  • 2
  • 10
  • 26
1

Switch on the verbose gc to now exactly when the full gc has happend. Because jstat shows FGC events even for major/tenured collections

For more info visit.

Akhil Jain
  • 13,872
  • 15
  • 57
  • 93
sridhar
  • 11
  • 1
0

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

baklarz2048
  • 10,699
  • 2
  • 31
  • 37
  • Cannot decrease perm gen space - as our application consumes it heavily... are there any disadvantage to using a high value for it? – Anna Oct 18 '10 at 10:44
  • Why does you application consume perm gen heavily ? Do You use dom xml parser or compare many strings an call intern ? – baklarz2048 Oct 18 '10 at 10:53
  • From the pdf link you have quoted: "When the young generation fills up, a young generation collection (sometimes referred to as a minor collection) of just that generation is performed. When the old or permanent generation fills up, what is known as a full collection (sometimes referred to as a major collection) is typically done" . What are those cases when the old/perm gen are not full and yet GC is done??. – Anna Oct 18 '10 at 10:55
  • Which app server do You use ? – baklarz2048 Oct 18 '10 at 11:02
  • You have problem with YG not PG or OG. Which collector do you use ? Tomcat in this version is a museum.leaks. First of all decrease PG (it use only 25%) or increase heap. – baklarz2048 Oct 19 '10 at 08:35