<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi Thomas, others,<br>
<br>
I'm trying to replace 3 collection state booleans into a simple GC
mode variable. This is technically collapsing 8 states into 3. But
when would we ever be in both young-only GC and full-gc at the same
time?<br>
<br>
OK, so the handy debug code I threw in notices the following:<br>
<br>
<blockquote>In G1CollectedHeap::do_collection()<br>
around line 1279:<br>
G1CollectorPolicy::record_full_collection_start()<br>
-> collector_state()->set_full_collection(true); <br>
<br>
around line 1340:<br>
-> collector_state()->set_gcs_are_young(true);<br>
<br>
around line 1474:<br>
G1CollectorPolicy::record_full_collection_end()<br>
-> collector_state()->set_full_collection(false); </blockquote>
<br>
Now this overlap doesn't really matter if no code checks the state
the the gc mode between lines 1340-1474, but of course it does.<br>
<br>
Strangely, the ONLY code that cares if we're doing a full collection
is some verification code - it bypasses certain verification when
doing full-collections, unless G1VerifyRSetsDuringFullGC is true.<br>
<br>
Going the other way, once remembered set processing occurs (after
line 1340), some of the accounting treats the GC as a young-only GC,
and there may be other cases that depend on gcs_are_young.<br>
<br>
As Kim pointed out to me earlier, I can expose this mixed state as
"young-only-coming-out-of-full-collection", and make it all work,
but that seems a bit awkward.<br>
<br>
Does anyone know why the verification around
"G1VerifyRSetsDuringFullGC" is ignored for full collections by
default? Should we just always do the verification for all gc-types?
Or should we move the verification before line 1340?<br>
<br>
Any other suggestions?<br>
<br>
Thanks,<br>
<br>
- Derek<br>
</body>
</html>