We've turned on verbose GC logging to keep track of a known memory leak and got the following entries in the log:
...
3607872.687: [GC 471630K->390767K(462208K), 0.0325540 secs]
3607873.213: [GC-- 458095K->462181K(462208K), 0.2757790 secs]
3607873.488: [Full GC 462181K->382186K(462208K), 1.5346420 secs]
...
I understand the first and third of those, but what does the "GC--" one mean?
I got the following from here:
Yishai said in the comments:
Actually, after encountering this in our own logs, a co-worker and I have an alternative explanation that seems to fit the facts more tightly.
You'll notice in this example that a Full GC follows this weird minor GC line. I can confirm that this is always the case when it crops up in our logs. You can also see that the beginning and end size of the Young Gen is equal, and I can again confirm that this is always the case.
We believe that what is happening here is that the VM has started a Minor GC and, after either not being able to free anything or spending too long without being able to free anything, decides to do a Full instead.
I got these kind of lines in my gc output:
I read Yishai's answer and it would make sense, but I wanted to see it for myself in the Java GC source code, when the JVM prints "--" in the GC log and why.
Because to my knowledge "Parallel Scavenge" of the Young Gen is a stop-the-world GC, so there couldn't be any objects created parallel to this GC. (see https://blogs.oracle.com/jonthecollector/entry/our_collectors)
You can find this in the jdk source code (see http://hg.openjdk.java.net/jdk7/jdk7) g1CollectedHeap.cpp and psScavenge.cpp
Reason for GC-- with the Parallel Scavenge Collector
The Young GC encountered a promotion failure (see http://mail.openjdk.java.net/pipermail/hotspot-gc-use/2010-March/000567.html):
'Not enough space' doesn't necessarily mean that there isn't enough space in old, but that the old space is heavily fragmented (see http://blog.ragozin.info/2011/10/java-cg-hotspots-cms-and-heap.html):
These two JVM options could help you analyze your heap fragmentation (see http://blog.ragozin.info/2011/10/java-cg-hotspots-cms-and-heap.html):
Reason for GC-- with the G1 Collector
A evacuation failure with the G1 is when a Survivor Region hasn't enough space for the surviving objects from a Young Region.
I don't know if the G1 Collector responds to a evacuation failure with a Full GC or not.
It is not on the Java GC FAQ
http://java.sun.com/docs/hotspot/gc1.4.2/faq.html
Nor is anything like that mentioned in the Java GC examples page
http://java.sun.com/docs/hotspot/gc1.4.2/example.html
I've never seen that before.
Do you have any special Garbage Collector running? What VM are you running? Does it always occur before Full GC? Are you calling System.gc()?