Skip to content

Commit 3018b47

Browse files
author
Thomas Schatzl
committed
8303969: Limit printed failures within an object during G1 heap verification
Reviewed-by: ayang, iwalulya
1 parent b575e54 commit 3018b47

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/hotspot/share/gc/g1/g1_globals.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,8 @@
214214
range(1, 100) \
215215
\
216216
develop(size_t, G1MaxVerifyFailures, SIZE_MAX, \
217-
"The maximum number of verification failures to print.") \
217+
"The maximum number of liveness and remembered set verification " \
218+
"failures to print per thread.") \
218219
range(1, SIZE_MAX) \
219220
\
220221
product(uintx, G1ReservePercent, 10, \

src/hotspot/share/gc/g1/heapRegion.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,10 @@ class G1VerifyLiveAndRemSetClosure : public BasicOopIterateClosure {
619619
assert(_containing_obj != nullptr, "must be");
620620
assert(!G1CollectedHeap::heap()->is_obj_dead_cond(_containing_obj, _vo), "Precondition");
621621

622+
if (num_failures() >= G1MaxVerifyFailures) {
623+
return;
624+
}
625+
622626
T heap_oop = RawAccess<>::oop_load(p);
623627
if (CompressedOops::is_null(heap_oop)) {
624628
return;

0 commit comments

Comments
 (0)