< prev index next >
src/share/vm/gc/g1/concurrentMarkThread.cpp
Print this page
*** 21,30 ****
--- 21,31 ----
* questions.
*
*/
#include "precompiled.hpp"
+ #include "classfile/classLoaderData.hpp"
#include "gc/g1/concurrentMarkThread.inline.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1CollectorPolicy.hpp"
#include "gc/g1/g1MMUTracker.hpp"
#include "gc/g1/suspendibleThreadSet.hpp"
*** 121,148 ****
while (!_should_terminate) {
// wait until started is set.
sleepBeforeNextCycle();
if (_should_terminate) {
break;
}
assert(GCId::current() != GCId::undefined(), "GC id should have been set up by the initial mark GC.");
{
ResourceMark rm;
HandleMark hm;
double cycle_start = os::elapsedVTime();
// We have to ensure that we finish scanning the root regions
// before the next GC takes place. To ensure this we have to
// make sure that we do not join the STS until the root regions
// have been scanned. If we did then it's possible that a
// subsequent GC could block us from joining the STS and proceed
// without the root regions have been scanned which would be a
// correctness issue.
! if (!cm()->has_aborted()) {
GCConcPhaseTimer(_cm, "Concurrent Root Region Scanning");
_cm->scanRootRegions();
}
// It would be nice to use the GCTraceConcTime class here but
--- 122,155 ----
while (!_should_terminate) {
// wait until started is set.
sleepBeforeNextCycle();
if (_should_terminate) {
+ _cm->root_regions()->cancel_scan();
break;
}
assert(GCId::current() != GCId::undefined(), "GC id should have been set up by the initial mark GC.");
{
ResourceMark rm;
HandleMark hm;
double cycle_start = os::elapsedVTime();
+ {
+ GCConcPhaseTimer(_cm, "Concurrent Clearing of Claimed Marks");
+ ClassLoaderDataGraph::clear_claimed_marks();
+ }
+
// We have to ensure that we finish scanning the root regions
// before the next GC takes place. To ensure this we have to
// make sure that we do not join the STS until the root regions
// have been scanned. If we did then it's possible that a
// subsequent GC could block us from joining the STS and proceed
// without the root regions have been scanned which would be a
// correctness issue.
! {
GCConcPhaseTimer(_cm, "Concurrent Root Region Scanning");
_cm->scanRootRegions();
}
// It would be nice to use the GCTraceConcTime class here but
< prev index next >