hotspot/src/share/vm/gc_implementation/shared/ageTable.cpp
changeset 24424 2658d7834c6e
parent 23506 9b98355e9060
child 25351 7c198a690050
equal deleted inserted replaced
24358:8528b67f6562 24424:2658d7834c6e
    82   size_t desired_survivor_size = (size_t)((((double) survivor_capacity)*TargetSurvivorRatio)/100);
    82   size_t desired_survivor_size = (size_t)((((double) survivor_capacity)*TargetSurvivorRatio)/100);
    83   uint result;
    83   uint result;
    84 
    84 
    85   if (AlwaysTenure || NeverTenure) {
    85   if (AlwaysTenure || NeverTenure) {
    86     assert(MaxTenuringThreshold == 0 || MaxTenuringThreshold == markOopDesc::max_age + 1,
    86     assert(MaxTenuringThreshold == 0 || MaxTenuringThreshold == markOopDesc::max_age + 1,
    87         err_msg("MaxTenuringThreshold should be 0 or markOopDesc::max_age + 1, but is ", MaxTenuringThreshold));
    87         err_msg("MaxTenuringThreshold should be 0 or markOopDesc::max_age + 1, but is " UINTX_FORMAT, MaxTenuringThreshold));
    88     result = MaxTenuringThreshold;
    88     result = MaxTenuringThreshold;
    89   } else {
    89   } else {
    90     size_t total = 0;
    90     size_t total = 0;
    91     uint age = 1;
    91     uint age = 1;
    92     assert(sizes[0] == 0, "no objects with age zero should be recorded");
    92     assert(sizes[0] == 0, "no objects with age zero should be recorded");
   104 
   104 
   105     if (PrintTenuringDistribution) {
   105     if (PrintTenuringDistribution) {
   106       gclog_or_tty->cr();
   106       gclog_or_tty->cr();
   107       gclog_or_tty->print_cr("Desired survivor size " SIZE_FORMAT " bytes, new threshold "
   107       gclog_or_tty->print_cr("Desired survivor size " SIZE_FORMAT " bytes, new threshold "
   108         UINTX_FORMAT " (max threshold " UINTX_FORMAT ")",
   108         UINTX_FORMAT " (max threshold " UINTX_FORMAT ")",
   109         desired_survivor_size*oopSize, result, MaxTenuringThreshold);
   109         desired_survivor_size*oopSize, (uintx) result, MaxTenuringThreshold);
   110     }
   110     }
   111 
   111 
   112     size_t total = 0;
   112     size_t total = 0;
   113     uint age = 1;
   113     uint age = 1;
   114     while (age < table_size) {
   114     while (age < table_size) {
   115       total += sizes[age];
   115       total += sizes[age];
   116       if (sizes[age] > 0) {
   116       if (sizes[age] > 0) {
   117         if (PrintTenuringDistribution) {
   117         if (PrintTenuringDistribution) {
   118           gclog_or_tty->print_cr("- age %3u: %10ld bytes, %10ld total",
   118           gclog_or_tty->print_cr("- age %3u: " SIZE_FORMAT_W(10) " bytes, " SIZE_FORMAT_W(10) " total",
   119             age, sizes[age]*oopSize, total*oopSize);
   119                                         age,    sizes[age]*oopSize,          total*oopSize);
   120         }
   120         }
   121       }
   121       }
   122       if (UsePerfData) {
   122       if (UsePerfData) {
   123         _perf_sizes[age]->set_value(sizes[age]*oopSize);
   123         _perf_sizes[age]->set_value(sizes[age]*oopSize);
   124       }
   124       }