Java Reference
In-Depth Information
space was promoted into the old generation at the same time; in addition, each mixed GC
cleans up only a portion of the targeted old generation regions. As we continue, we'll see that
it is important to make sure that the mixed GCs clean up enough memory to prevent future
concurrent failures.
The mixed GC cycles will continue until (almost) all of the marked regions have been collec-
ted, at which point G1 will resume regular young GC cycles. Eventually, G1 will start anoth-
er concurrent cycle to determine which regions should be freed next.
As with CMS, there are times when you'll observe a full GC in the log, which is an indica-
tion that more tuning (including, possibly, more heap space) will benefit the application per-
formance. There are primarily four times when this is triggered:
Concurrent mode failure
G1 starts a marking cycle, but the old generation fills up before the cycle is completed. In
that case, G1 aborts the marking cycle:
51.408: [GC concurrent-mark-start]
65.473: [Full GC 4095M->1395M(4096M), 6.1963770 secs]
[Times: user=7.87 sys=0.00, real=6.20 secs]
71.669: [GC concurrent-mark-abort]
This failure means that heap size should be increased, or the G1 background processing
must begin sooner, or the cycle must be tuned to run more quickly (e.g., by using addi-
tional background threads).
Promotion failure
G1 has completed a marking cycle and has started performing mixed GCs to clean up the
old regions, but the old generation runs out of space before enough memory can be re-
claimed from the old generation. In the log, a full GC immediately follows a mixed GC:
2226.224: [GC pause (mixed)
2226.440: [SoftReference, 0 refs, 0.0000060 secs]
2226.441: [WeakReference, 0 refs, 0.0000020 secs]
2226.441: [FinalReference, 0 refs, 0.0000010 secs]
2226.441: [PhantomReference, 0 refs, 0.0000010 secs]
2226.441: [JNI Weak Reference, 0.0000030 secs]
(to-space exhausted), 0.2390040 secs]
....
Search WWH ::




Custom Search