aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjohnc <none@none>2013-06-04 10:04:06 -0700
committerjohnc <none@none>2013-06-04 10:04:06 -0700
commit0fdf298c246ab94eea8e0109a80dff118400d4ba (patch)
tree3a5929a8d526603b01a525bf0487fbf09e7303dc /src
parent3d4fa3c2acd30208128b29e0ae75d156af7ce72c (diff)
downloadjdk8u_hotspot-0fdf298c246ab94eea8e0109a80dff118400d4ba.tar.gz
8015244: G1: Verification after a full GC is incorrectly placed.
Summary: In a full GC, move the verification after the GC to after RSet rebuilding. Verify RSet entries during a full GC under control of a flag. Reviewed-by: tschatzl, brutisso
Diffstat (limited to 'src')
-rw-r--r--src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp4
-rw-r--r--src/share/vm/gc_implementation/g1/g1RemSet.cpp2
-rw-r--r--src/share/vm/gc_implementation/g1/g1_globals.hpp6
-rw-r--r--src/share/vm/gc_implementation/g1/heapRegion.cpp2
4 files changed, 9 insertions, 5 deletions
diff --git a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
index aff2d5da6..0505822e8 100644
--- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
+++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
@@ -1417,8 +1417,6 @@ bool G1CollectedHeap::do_collection(bool explicit_gc,
MemoryService::track_memory_usage();
- verify_after_gc();
-
assert(!ref_processor_stw()->discovery_enabled(), "Postcondition");
ref_processor_stw()->verify_no_references_recorded();
@@ -1521,6 +1519,8 @@ bool G1CollectedHeap::do_collection(bool explicit_gc,
_hrs.verify_optional();
verify_region_sets_optional();
+ verify_after_gc();
+
// Start a new incremental collection set for the next pause
assert(g1_policy()->collection_set() == NULL, "must be");
g1_policy()->start_incremental_cset_building();
diff --git a/src/share/vm/gc_implementation/g1/g1RemSet.cpp b/src/share/vm/gc_implementation/g1/g1RemSet.cpp
index ae4c6b635..673814ce9 100644
--- a/src/share/vm/gc_implementation/g1/g1RemSet.cpp
+++ b/src/share/vm/gc_implementation/g1/g1RemSet.cpp
@@ -736,7 +736,7 @@ void G1RemSet::print_summary_info(G1RemSetSummary * summary, const char * header
void G1RemSet::prepare_for_verify() {
if (G1HRRSFlushLogBuffersOnVerify &&
(VerifyBeforeGC || VerifyAfterGC)
- && !_g1->full_collection()) {
+ && (!_g1->full_collection() || G1VerifyRSetsDuringFullGC)) {
cleanupHRRS();
_g1->set_refine_cte_cl_concurrency(false);
if (SafepointSynchronize::is_at_safepoint()) {
diff --git a/src/share/vm/gc_implementation/g1/g1_globals.hpp b/src/share/vm/gc_implementation/g1/g1_globals.hpp
index 7e62b70cd..36dfdce6d 100644
--- a/src/share/vm/gc_implementation/g1/g1_globals.hpp
+++ b/src/share/vm/gc_implementation/g1/g1_globals.hpp
@@ -329,7 +329,11 @@
\
develop(bool, G1EvacuationFailureALotDuringMixedGC, true, \
"Force use of evacuation failure handling during mixed " \
- "evacuation pauses")
+ "evacuation pauses") \
+ \
+ diagnostic(bool, G1VerifyRSetsDuringFullGC, false, \
+ "If true, perform verification of each heap region's " \
+ "remembered set when verifying the heap during a full GC.")
G1_FLAGS(DECLARE_DEVELOPER_FLAG, DECLARE_PD_DEVELOPER_FLAG, DECLARE_PRODUCT_FLAG, DECLARE_PD_PRODUCT_FLAG, DECLARE_DIAGNOSTIC_FLAG, DECLARE_EXPERIMENTAL_FLAG, DECLARE_NOTPRODUCT_FLAG, DECLARE_MANAGEABLE_FLAG, DECLARE_PRODUCT_RW_FLAG)
diff --git a/src/share/vm/gc_implementation/g1/heapRegion.cpp b/src/share/vm/gc_implementation/g1/heapRegion.cpp
index f33e0456e..7ef24358e 100644
--- a/src/share/vm/gc_implementation/g1/heapRegion.cpp
+++ b/src/share/vm/gc_implementation/g1/heapRegion.cpp
@@ -139,7 +139,7 @@ public:
_n_failures++;
}
- if (!_g1h->full_collection()) {
+ if (!_g1h->full_collection() || G1VerifyRSetsDuringFullGC) {
HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p);
HeapRegion* to = _g1h->heap_region_containing(obj);
if (from != NULL && to != NULL &&