8176565: G1 Does not perform heap verification after remark with VerifyAfterGC

Aleksey Shipilev shade at redhat.com
Mon Mar 13 15:27:37 UTC 2017

On 03/13/2017 03:58 PM, Mikael Gerdin wrote:
> Hi all,
> Please review this small change to when G1 performs heap verification.
> Background to this change is that it is fairly common knowledge that in order to
> rule out GC bugs you should run with -XX:+VerifyBeforeGC -XX:+VerifyAfterGC.
> In order to make it easier for people to get the kind of heap verification they
> expect we should have G1 perform a verification at the end of the remark phase
> similar to what CMS does.
> Previously this verification has only been enabled with -XX:+VerifyDuringGC for
> G1 but that is a lesser known flag and I think we should try to make it easier
> for our users to get the verification passes they expect.
> This is a low-risk fix and it will be good to have in 9.0 for debugging purposes.
> Webrev: http://cr.openjdk.java.net/~mgerdin/8176565/webrev.0/

While I agree this is good change, I wonder if you want a global verification
option that does not mention any particular GC phase, e.g. -XX:+VerifyGC. Then,
external users can rely on GC developers to put the verification points within
the GC, where they think verification is needed. (We do this in Shenandoah with

That flag may just ergonomically enable all three verification options:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <https://mail.openjdk.java.net/pipermail/hotspot-gc-dev/attachments/20170313/ae1ee7e2/signature.asc>

More information about the hotspot-gc-dev mailing list