Java GC Ambiguous Protocol Message

I am running a Java client with Java JRE on 32 bit windows,

java -Xmx1024m -Xms1024m -verbose:gc -XX:+PrintGCDetails -jar myJar.jar 

My jar contains a lot of data (doubling tables, 600 thousand MB) that remain in the memory for the entire life of the application.

He then issues registration messages every minute, saying:

[GC [DefNew: 279616K-> 279616K (314560K), 0.0002037 secs] [Calculated: 595827K-> 599952K (699072K), 1.1020398 secs] 875443K-> 599952K (1013632K), [Perm: 10042K-> 10042K) ], 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 that the new generation goes from 279616K to 279616K (i.e. nothing has changed), the old generation has increased slightly (595827K-> 599952K), but in general it says 875443K-> 599952K, i.e. 30% reduction. How can it be?

edit: to be completely clear, I expected that if I add 279616K + 595827K = 875443K, I will get the first part in bold, i.e. the total heap size. Likewise, I expected 279616K + 599952K to highlight the second part in bold, but that is not the case. In the Java Java Garbage Log Messages link, listed below, it really stacks up, so I'm probably missing something.

+4
source share
2 answers

The fact is that DefNew and Tenured are the results of small collections, while the Tenured also include the result of the next main collection. Thus, the young generation cannot be successfully assembled during a small collection and is assembled only for a large collection.

Diagnosing the garbage collection problem suggests that this may be caused by the too young generation:

[GC [DefNew: 16000K-> 16000K (16192K), 0.0000498 seconds] [Loaded: 2535K-> 2319K (16384K), 0.0860925 sec] 18535K-> 2319K (32576K), 0.0863350 seconds]

This is an example of the relative size of the young generation to the generation that is too large to protect the young generation (the young generation is about half the size of generations). The younger generation cannot be successfully assembled, and only large collections occur. Please note that in this case, the younger generation is going to, but only as part of a more expensive large collection.

I think in your case this can also be caused by the lack of free space in the generation.

+3
source

You need to look a little more in SO before asking. Anyway, look at this:

Java garbage collection log messages

+1
source

Source: https://habr.com/ru/post/1344654/


All Articles