< prev index next >

src/share/vm/runtime/synchronizer.cpp

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

@@ -960,10 +960,14 @@
   block = block->FreeNext;
   assert(block == NULL || block->object() == CHAINMARKER, "must be a block header");
   return block;
 }
 
+bool ObjectSynchronizer::is_cleanup_needed() {
+  int monitors_used = gMonitorPopulation - gMonitorFreeCount;
+  return MonitorUsedDeflationThreshold > 0 && (monitors_used * 100LL) / gMonitorPopulation > MonitorUsedDeflationThreshold;
+}
 
 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 >