< prev index next >

src/share/vm/runtime/synchronizer.cpp

Print this page
rev 13098 : imported patch deflation
rev 13099 : imported patch deflation_2
rev 13100 : [mq]: deflation_3

@@ -960,10 +960,22 @@
   block = block->FreeNext;
   assert(block == NULL || block->object() == CHAINMARKER, "must be a block header");
   return block;
 }
 
+static bool monitors_used_above_threshold() {
+  int monitors_used = gMonitorPopulation - gMonitorFreeCount;
+  int monitor_useage = (monitors_used * 100LL) / gMonitorPopulation;
+  return monitor_useage > MonitorUsedDeflationThreshold;
+}
+
+bool ObjectSynchronizer::is_cleanup_needed() {
+  if (MonitorUsedDeflationThreshold > 0) {
+    return monitors_used_above_threshold();
+  }
+  return false;
+}
 
 void ObjectSynchronizer::oops_do(OopClosure* f) {
   if (MonitorInUseLists) {
     // When using thread local monitor lists, we only scan the
     // global used list here (for moribund threads), and
< prev index next >