< prev index next >

src/share/vm/gc_implementation/shared/ageTable.cpp

Print this page

        

@@ -22,10 +22,11 @@
  *
  */
 
 #include "precompiled.hpp"
 #include "gc_implementation/shared/ageTable.hpp"
+#include "gc_implementation/shared/ageTableTracer.hpp"
 #include "gc_implementation/shared/gcPolicyCounters.hpp"
 #include "memory/collectorPolicy.hpp"
 #include "memory/resourceArea.hpp"
 #include "memory/sharedHeap.hpp"
 #include "utilities/copy.hpp"

@@ -76,11 +77,11 @@
   for (int i = 0; i < table_size; i++) {
     Atomic::add_ptr(subTable->sizes[i], &sizes[i]);
   }
 }
 
-uint ageTable::compute_tenuring_threshold(size_t survivor_capacity) {
+uint ageTable::compute_tenuring_threshold(size_t survivor_capacity, GCTracer &tracer) {
   size_t desired_survivor_size = (size_t)((((double) survivor_capacity)*TargetSurvivorRatio)/100);
   size_t total = 0;
   uint age = 1;
   assert(sizes[0] == 0, "no objects with age zero should be recorded");
   while (age < table_size) {

@@ -90,11 +91,11 @@
     if (total > desired_survivor_size) break;
     age++;
   }
   uint result = age < MaxTenuringThreshold ? age : MaxTenuringThreshold;
 
-  if (PrintTenuringDistribution || UsePerfData) {
+  if (PrintTenuringDistribution || UsePerfData || AgeTableTracer::is_tenuring_distribution_event_enabled()) {
 
     if (PrintTenuringDistribution) {
       gclog_or_tty->cr();
       gclog_or_tty->print_cr("Desired survivor size " SIZE_FORMAT " bytes, new threshold %u (max %u)",
         desired_survivor_size*oopSize, result, (int) MaxTenuringThreshold);

@@ -108,10 +109,11 @@
         if (PrintTenuringDistribution) {
           gclog_or_tty->print_cr("- age %3u: " SIZE_FORMAT_W(10) " bytes, " SIZE_FORMAT_W(10) " total",
                                         age,    sizes[age]*oopSize,          total*oopSize);
         }
       }
+      AgeTableTracer::send_tenuring_distribution_event(age, wordSize * oopSize, tracer);
       if (UsePerfData) {
         _perf_sizes[age]->set_value(sizes[age]*oopSize);
       }
       age++;
     }
< prev index next >