I am investigating performance problems on an EE application which are probably a result of a less than optimally tuned garbage collector.
While looking into jstat
logs I gathered under heavy load I stumbled upon the following finding:
S0 S1 E O P
7.39 0.00 41.81 88.89 53.93
NGCMN NGCMX NGC S0C S1C
131072.0 301056.0 301056.0 30080.0 30080.0
EC OGCMN OGCMX OGC
240896.0 1441792.0 2058240.0 2058240.0
As per the official jstat documentation here we can see that the current old generation size (OGC) has reached the maximum old generation size (OGCMX). The first line however tells us that "Old space utilization as a percentage of the space's current capacity" (O) is "only" at 88%.
My questions are:
- What mechanic is setting the old generation limit seeen as OGCMX in the jstat output?
- What is keeping old space from growing and using up the remaning ~12% of heap?
We have JVM parameters which are setting the min/max for total heap, new space and perm space (-Xms -Xmx -XX:NewSize -XX:MaxNewSize -XX:PermSize -XX:MaxPermSize
).
But there are no limits set on old space (I don't know if such parameters even exist).
Edit concerning NewRatio:
It is my understadning and also mentioned here that the JVM does not enforce the ratio between new and old space, especially not if the MaxNewSize
param is used. And the MaxNewSize
param is accepted, as the value above (301056.0KB) is in fact exactly the 294MB we are specifying for MaxNewSize
. Furthermore, the default value for NewRatio is 2 (see here), which is not at all the ratio between any of the above values listed by jstat.