From a2d4214c94ae4a5c3654c4ca2ad534e2bba5ae94 Mon Sep 17 00:00:00 2001 From: pliden Date: Wed, 14 May 2014 14:32:23 +0200 Subject: [PATCH] 8040804: G1: Concurrent mark stuck in loop calling os::elapsedVTime() Reviewed-by: brutisso, tschatzl --- src/share/vm/gc_implementation/g1/concurrentMark.cpp | 2 +- src/share/vm/gc_implementation/g1/concurrentMark.hpp | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/share/vm/gc_implementation/g1/concurrentMark.cpp b/src/share/vm/gc_implementation/g1/concurrentMark.cpp index 96eafa82e..977f1f9f1 100644 --- a/src/share/vm/gc_implementation/g1/concurrentMark.cpp +++ b/src/share/vm/gc_implementation/g1/concurrentMark.cpp @@ -819,7 +819,7 @@ void ConcurrentMark::set_concurrency_and_phase(uint active_tasks, bool concurren // false before we start remark. At this point we should also be // in a STW phase. assert(!concurrent_marking_in_progress(), "invariant"); - assert(_finger == _heap_end, + assert(out_of_regions(), err_msg("only way to get here: _finger: "PTR_FORMAT", _heap_end: "PTR_FORMAT, p2i(_finger), p2i(_heap_end))); update_g1_committed(true); diff --git a/src/share/vm/gc_implementation/g1/concurrentMark.hpp b/src/share/vm/gc_implementation/g1/concurrentMark.hpp index ed129d6e8..8808ed1a7 100644 --- a/src/share/vm/gc_implementation/g1/concurrentMark.hpp +++ b/src/share/vm/gc_implementation/g1/concurrentMark.hpp @@ -542,8 +542,12 @@ protected: // frequently. HeapRegion* claim_region(uint worker_id); - // It determines whether we've run out of regions to scan. - bool out_of_regions() { return _finger == _heap_end; } + // It determines whether we've run out of regions to scan. Note that + // the finger can point past the heap end in case the heap was expanded + // to satisfy an allocation without doing a GC. This is fine, because all + // objects in those regions will be considered live anyway because of + // SATB guarantees (i.e. their TAMS will be equal to bottom). + bool out_of_regions() { return _finger >= _heap_end; } // Returns the task with the given id CMTask* task(int id) { -- GitLab