For those finding GC terms difficult and want see what actually these terms (perm/young/old generations, survivor spaces, etc ) means, there is a visual gc plugin which can be installed to visual vm shipping with jdk 1.6. Basically Visual VM looks like an improved version of jconsole tool with an add-in architecture.
Below I uploaded a visual gc picture of a java app running locally. Thanks to visual gc plugin, it’s quite easy to monitor and visualize memory consumption of java applications.
|Java Visual GC|
After seeing the picture, it’s time to revisit some GC parameters as;
--XX: NewRatio –> Old / (Eden + S0 +S1)
--XX: SurvivorRatio –> Eden / S0
--XX: MaxPermSize –> Perm
where S0 equals S1 and they are called From and To survivor spaces, while Eden + S0 + S1 altogether define young generation size.
Recalling that a java app's min and max memory sizes are defined by -Xms and -Xmx, Jvm will split an app's memory into Perm, Old, Eden, S0,S1 regions according to ratios above.