26 #include "gc/shared/ageTable.hpp" |
26 #include "gc/shared/ageTable.hpp" |
27 #include "gc/shared/collectedHeap.hpp" |
27 #include "gc/shared/collectedHeap.hpp" |
28 #include "gc/shared/collectorPolicy.hpp" |
28 #include "gc/shared/collectorPolicy.hpp" |
29 #include "gc/shared/gcPolicyCounters.hpp" |
29 #include "gc/shared/gcPolicyCounters.hpp" |
30 #include "memory/resourceArea.hpp" |
30 #include "memory/resourceArea.hpp" |
|
31 #include "logging/log.hpp" |
31 #include "utilities/copy.hpp" |
32 #include "utilities/copy.hpp" |
32 |
33 |
33 /* Copyright (c) 1992, 2015, Oracle and/or its affiliates, and Stanford University. |
34 /* Copyright (c) 1992, 2015, Oracle and/or its affiliates, and Stanford University. |
34 See the LICENSE file for license information. */ |
35 See the LICENSE file for license information. */ |
35 |
36 |
92 age++; |
93 age++; |
93 } |
94 } |
94 result = age < MaxTenuringThreshold ? age : MaxTenuringThreshold; |
95 result = age < MaxTenuringThreshold ? age : MaxTenuringThreshold; |
95 } |
96 } |
96 |
97 |
97 if (PrintTenuringDistribution || UsePerfData) { |
|
98 |
98 |
99 if (PrintTenuringDistribution) { |
99 log_debug(gc, age)("Desired survivor size " SIZE_FORMAT " bytes, new threshold " UINTX_FORMAT " (max threshold " UINTX_FORMAT ")", |
100 gclog_or_tty->cr(); |
100 desired_survivor_size*oopSize, (uintx) result, MaxTenuringThreshold); |
101 gclog_or_tty->print_cr("Desired survivor size " SIZE_FORMAT " bytes, new threshold " |
|
102 UINTX_FORMAT " (max threshold " UINTX_FORMAT ")", |
|
103 desired_survivor_size*oopSize, (uintx) result, MaxTenuringThreshold); |
|
104 } |
|
105 |
101 |
|
102 if (log_is_enabled(Trace, gc, age) || UsePerfData) { |
106 size_t total = 0; |
103 size_t total = 0; |
107 uint age = 1; |
104 uint age = 1; |
108 while (age < table_size) { |
105 while (age < table_size) { |
109 total += sizes[age]; |
106 total += sizes[age]; |
110 if (sizes[age] > 0) { |
107 if (sizes[age] > 0) { |
111 if (PrintTenuringDistribution) { |
108 log_trace(gc, age)("- age %3u: " SIZE_FORMAT_W(10) " bytes, " SIZE_FORMAT_W(10) " total", |
112 gclog_or_tty->print_cr("- age %3u: " SIZE_FORMAT_W(10) " bytes, " SIZE_FORMAT_W(10) " total", |
109 age, sizes[age]*oopSize, total*oopSize); |
113 age, sizes[age]*oopSize, total*oopSize); |
|
114 } |
|
115 } |
110 } |
116 if (UsePerfData) { |
111 if (UsePerfData) { |
117 _perf_sizes[age]->set_value(sizes[age]*oopSize); |
112 _perf_sizes[age]->set_value(sizes[age]*oopSize); |
118 } |
113 } |
119 age++; |
114 age++; |