Why does the JVM make so many garbage collectors

Below is the output of jstat from a JVM working with the following parameters

 -Xmx10240m -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode 

Jstat output with parameters

 jstat -gcutil <pid> 10s 

The section is fragmented for 80 seconds, and according to statistics, almost 70 seconds of this is spent on the GC. These are all full GCs that run.

 Timestamp S0 S1 EOP YGC YGCT FGC FGCT GCT Diff 1040430.2 0 0 23.69 24.58 95.03 168048 22187.057 3672 4483.931 26670.988 8.175 1040440.2 0 0 0.1 24.58 95.02 168048 22187.057 3674 4495.551 26682.608 11.62 1040450.2 0 0 4.19 24.59 95.03 168048 22187.057 3677 4506.731 26693.788 11.18 1040460.2 0 0 0.01 24.45 95.02 168048 22187.057 3679 4517.391 26704.448 10.66 1040470.2 0 0 0.33 24.45 95.03 168048 22187.057 3681 4522.213 26709.27 4.822 1040480.2 0 0 0 24.43 95.02 168048 22187.057 3684 4534.816 26721.874 12.604 

The PermGen space works almost completely, but I did not think that the Sun GC mechanism would try to assemble here, and I can see the reason compiled on the basis of Eden or Old.

Anyone who can give me a few pointers relates to what might happen?

+4
source share
1 answer

Why does the JVM make so many garbage collections.

This is most likely because the employment in the permanent generation is quite high. When using the CMS algorithm, the main collection is triggered only when the filling of old or permanent generations exceeds a certain threshold. The default fill threshold for the old generation is 68%, if I'm not mistaken, and this can be changed using the -XX:CMSInitiatingOccupancyFraction=n flag. However, in the context of the data presented, this value seems insignificant, since the employment of the old generation seems to be less than 25% when the statistics were taken (this does not mean that the old generation was not filled with an intermediate, but it is unlikely when the permanent generation itself shows a higher download).

Please note that the default CMS collector does not pretend to be from a permanent generation. To do this, enable the CMSClassUnloading flag. If the behavior does not improve, then most likely the permanent generation will be incorrectly evaluated, and it will need to get more memory, since it would be obvious that only a few of the objects in the permanent generation have the right to collect each main collection cycle.

+3
source

All Articles