aboutsummaryrefslogtreecommitdiff
path: root/src/share/vm/gc_implementation
diff options
context:
space:
mode:
authorbrutisso <none@none>2014-04-23 12:37:36 +0200
committerbrutisso <none@none>2014-04-23 12:37:36 +0200
commitfc3e9dfa9cdedc99862950e5b69cee8ef0e4b288 (patch)
treef26b7d14c6622b176bf9c8c9ecd3a391667f49e6 /src/share/vm/gc_implementation
parent943e910eb1d32b70da0852a7b6be5d8f5ffc8613 (diff)
downloadjdk8u_hotspot-fc3e9dfa9cdedc99862950e5b69cee8ef0e4b288.tar.gz
8038265: CMS: enable time based triggering of concurrent cycles
Reviewed-by: mgerdin, brutisso Contributed-by: michal@frajt.eu
Diffstat (limited to 'src/share/vm/gc_implementation')
-rw-r--r--src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
index f96151c90..0f3436007 100644
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
@@ -1514,6 +1514,8 @@ bool CMSCollector::shouldConcurrentCollect() {
gclog_or_tty->print_cr("cms_allocation_rate=%g", stats().cms_allocation_rate());
gclog_or_tty->print_cr("occupancy=%3.7f", _cmsGen->occupancy());
gclog_or_tty->print_cr("initiatingOccupancy=%3.7f", _cmsGen->initiating_occupancy());
+ gclog_or_tty->print_cr("cms_time_since_begin=%3.7f", stats().cms_time_since_begin());
+ gclog_or_tty->print_cr("cms_time_since_end=%3.7f", stats().cms_time_since_end());
gclog_or_tty->print_cr("metadata initialized %d",
MetaspaceGC::should_concurrent_collect());
}
@@ -1576,6 +1578,28 @@ bool CMSCollector::shouldConcurrentCollect() {
return true;
}
+ // CMSTriggerInterval starts a CMS cycle if enough time has passed.
+ if (CMSTriggerInterval >= 0) {
+ if (CMSTriggerInterval == 0) {
+ // Trigger always
+ return true;
+ }
+
+ // Check the CMS time since begin (we do not check the stats validity
+ // as we want to be able to trigger the first CMS cycle as well)
+ if (stats().cms_time_since_begin() >= (CMSTriggerInterval / ((double) MILLIUNITS))) {
+ if (Verbose && PrintGCDetails) {
+ if (stats().valid()) {
+ gclog_or_tty->print_cr("CMSCollector: collect because of trigger interval (time since last begin %3.7f secs)",
+ stats().cms_time_since_begin());
+ } else {
+ gclog_or_tty->print_cr("CMSCollector: collect because of trigger interval (first collection)");
+ }
+ }
+ return true;
+ }
+ }
+
return false;
}