I’m the starting the Java client with the Java JRE on 32bits windows, with
java -Xmx1024m -Xms1024m -verbose:gc -XX:+PrintGCDetails -jar myJar.jar
My jar contains a lot of data (tables of doubles, 600ish MB) which stay in memory for the entire life of the application.
It then gives logging messages, about each minute, saying:
[GC [DefNew: 279616K->279616K(314560K), 0.0002037 secs][Tenured: 595827K->599952K(699072K), 1.1020398 secs] 875443K->599952K(1013632K), [Perm : 10042K->10042K(16384K)], 1.1030218 secs] [Times: user=1.09 sys=0.01, real=1.11 secs]
and I really don’t understand the bold part. It says the new generation goes from 279616K to 279616K (ie nothing changed), the old generation slightly increased (595827K->599952K) but in total it says 875443K->599952K, ie a ~30% reduction. How can this be?
edit: to be completely clear, I’d expected that if I add 279616K+595827K=875443K I get the first part in bold, ie the total heap size. Likewise, I’d expected that 279616K+599952K would total the second part in bold, but it doesn’t. In the link Java Garbage Collection Log messages, specified below, it does add up, so I’m probably missing something.
The point is that
DefNewandTenuredare results of minor collections, whereas the overall numbers also include the result of the following major collection. So, young generation can’t be collected successfully during a minor collection and is only collected by major collection.Diagnosing a Garbage Collection problem suggests that it can be caused by young generation being too large:
I guess in your case it also can be caused by lack of free space in the tenured generation.