提交 0f24cda1 编写于 作者: S stefank

8049831: Metadata Full GCs are not triggered when CMSClassUnloadingEnabled is turned off

Reviewed-by: brutisso, tschatzl, ehelin, jmasa, dfazunen
上级 4cef28b1
/* /*
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -211,28 +211,29 @@ void VM_GenCollectFull::doit() { ...@@ -211,28 +211,29 @@ void VM_GenCollectFull::doit() {
bool VM_CollectForMetadataAllocation::initiate_concurrent_GC() { bool VM_CollectForMetadataAllocation::initiate_concurrent_GC() {
#if INCLUDE_ALL_GCS #if INCLUDE_ALL_GCS
if (UseConcMarkSweepGC || UseG1GC) { if (UseConcMarkSweepGC && CMSClassUnloadingEnabled) {
if (UseConcMarkSweepGC && CMSClassUnloadingEnabled) { MetaspaceGC::set_should_concurrent_collect(true);
MetaspaceGC::set_should_concurrent_collect(true); return true;
} else if (UseG1GC) { }
G1CollectedHeap* g1h = G1CollectedHeap::heap();
g1h->g1_policy()->set_initiate_conc_mark_if_possible();
GCCauseSetter x(g1h, _gc_cause); if (UseG1GC) {
G1CollectedHeap* g1h = G1CollectedHeap::heap();
g1h->g1_policy()->set_initiate_conc_mark_if_possible();
// At this point we are supposed to start a concurrent cycle. We GCCauseSetter x(g1h, _gc_cause);
// will do so if one is not already in progress.
bool should_start = g1h->g1_policy()->force_initial_mark_if_outside_cycle(_gc_cause);
if (should_start) { // At this point we are supposed to start a concurrent cycle. We
double pause_target = g1h->g1_policy()->max_pause_time_ms(); // will do so if one is not already in progress.
g1h->do_collection_pause_at_safepoint(pause_target); bool should_start = g1h->g1_policy()->force_initial_mark_if_outside_cycle(_gc_cause);
}
}
if (should_start) {
double pause_target = g1h->g1_policy()->max_pause_time_ms();
g1h->do_collection_pause_at_safepoint(pause_target);
}
return true; return true;
} }
#endif #endif
return false; return false;
} }
......
...@@ -169,6 +169,7 @@ compact1 = \ ...@@ -169,6 +169,7 @@ compact1 = \
# #
needs_full_vm_compact1 = \ needs_full_vm_compact1 = \
runtime/NMT \ runtime/NMT \
gc/class_unloading/TestCMSClassUnloadingDisabledHWM.java \
gc/g1/TestRegionAlignment.java \ gc/g1/TestRegionAlignment.java \
gc/g1/TestShrinkToOneRegion.java \ gc/g1/TestShrinkToOneRegion.java \
gc/metaspace/G1AddMetaspaceDependency.java \ gc/metaspace/G1AddMetaspaceDependency.java \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册