VerifyGCType is a flag to control during which pauses to do verification.
Verification before and after young collection checks this flag only for the "main" bulk of verification, not others.
Eg. from G1CollectedHeap::verify_before_young_collection:
void G1CollectedHeap::verify_before_young_collection(G1HeapVerifier::G1VerifyType type) {
if (!VerifyBeforeGC) {
return;
}
Ticks start = Ticks::now();
_verifier->verify_region_sets_optional();
_verifier->verify_dirty_young_regions();
if (VerifyRememberedSets) {
log_info(gc, verify)("[Verifying RemSets before GC]");
VerifyRegionRemSetClosure v_cl;
heap_region_iterate(&v_cl);
}
_verifier->verify_before_gc(type); <---- !!!! only this call honors verification type
_verifier->check_bitmaps("GC Start");
verify_numa_regions("GC Start");
phase_times()->record_verify_before_time_ms((Ticks::now() - start).seconds() * MILLIUNITS);
Only the marked call honors the verification type. Everything else is executed unconditionally when VerifyBeforeGC is enabled. Similar with VerifyAfterGC.
Verification before and after young collection checks this flag only for the "main" bulk of verification, not others.
Eg. from G1CollectedHeap::verify_before_young_collection:
void G1CollectedHeap::verify_before_young_collection(G1HeapVerifier::G1VerifyType type) {
if (!VerifyBeforeGC) {
return;
}
Ticks start = Ticks::now();
_verifier->verify_region_sets_optional();
_verifier->verify_dirty_young_regions();
if (VerifyRememberedSets) {
log_info(gc, verify)("[Verifying RemSets before GC]");
VerifyRegionRemSetClosure v_cl;
heap_region_iterate(&v_cl);
}
_verifier->verify_before_gc(type); <---- !!!! only this call honors verification type
_verifier->check_bitmaps("GC Start");
verify_numa_regions("GC Start");
phase_times()->record_verify_before_time_ms((Ticks::now() - start).seconds() * MILLIUNITS);
Only the marked call honors the verification type. Everything else is executed unconditionally when VerifyBeforeGC is enabled. Similar with VerifyAfterGC.