< prev index next >

src/share/vm/gc/shared/adaptiveSizePolicy.cpp

Print this page
rev 12310 : [mq]: gcinterface.patch

@@ -123,11 +123,11 @@
   // Choose a number of GC threads based on the current size
   // of the heap.  This may be complicated because the size of
   // the heap depends on factors such as the throughput goal.
   // Still a large heap should be collected by more GC threads.
   active_workers_by_heap_size =
-      MAX2((size_t) 2U, Universe::heap()->capacity() / HeapSizePerGCThread);
+      MAX2((size_t) 2U, GC::gc()->heap()->capacity() / HeapSizePerGCThread);
 
   uintx max_active_workers =
     MAX2(active_workers_by_JT, active_workers_by_heap_size);
 
   new_active_workers = MIN2(max_active_workers, (uintx) total_workers);

@@ -627,5 +627,28 @@
     log_debug(gc, ergo)("Tenuring threshold: (attempted to increase to balance GC costs) = %u", new_tenuring_threshold_arg);
   } else {
     assert(!tenuring_threshold_change(), "(no change was attempted)");
   }
 }
+
+bool AdaptiveSizePolicyOutput::enabled() {
+  return UseParallelGC &&
+    UseAdaptiveSizePolicy &&
+    log_is_enabled(Debug, gc, ergo);
+}
+
+void AdaptiveSizePolicyOutput::print() {
+  if (enabled()) {
+    GC::gc()->heap()->size_policy()->print();
+  }
+}
+
+void AdaptiveSizePolicyOutput::print(AdaptiveSizePolicy* size_policy, uint count) {
+  bool do_print =
+    enabled() &&
+    (AdaptiveSizePolicyOutputInterval > 0) &&
+    (count % AdaptiveSizePolicyOutputInterval) == 0;
+
+  if (do_print) {
+    size_policy->print();
+  }
+}
< prev index next >