15 * 2 along with this work; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19 * or visit www.oracle.com if you need additional information or have any
20 * questions.
21 *
22 */
23
24 #include "precompiled.hpp"
25
26 #include "gc_implementation/shenandoah/shenandoahAllocTracker.hpp"
27 #include "utilities/ostream.hpp"
28
29 void ShenandoahAllocTracker::print_on(outputStream* out) const {
30 out->print_cr("ALLOCATION TRACING");
31 out->print_cr(" These are the slow-path allocations, including TLAB/GCLAB refills, and out-of-TLAB allocations.");
32 out->print_cr(" In-TLAB/GCLAB allocations happen orders of magnitude more frequently, and without delays.");
33 out->cr();
34
35 out->print("%18s", "");
36 for (size_t t = 0; t < ShenandoahHeap::_ALLOC_LIMIT; t++) {
37 out->print("%12s", ShenandoahHeap::alloc_type_to_string(ShenandoahHeap::AllocType(t)));
38 }
39 out->cr();
40
41 out->print_cr("Counts:");
42 out->print("%18s", "#");
43 for (size_t t = 0; t < ShenandoahHeap::_ALLOC_LIMIT; t++) {
44 out->print(SIZE_FORMAT_W(12), _alloc_size[t].num());
45 }
46 out->cr();
47 out->cr();
48
49 // Figure out max and min levels
50 int lat_min_level = +1000;
51 int lat_max_level = -1000;
52 int size_min_level = +1000;
53 int size_max_level = -1000;
54 for (size_t t = 0; t < ShenandoahHeap::_ALLOC_LIMIT; t++) {
55 lat_min_level = MIN2(lat_min_level, _alloc_latency[t].min_level());
56 lat_max_level = MAX2(lat_max_level, _alloc_latency[t].max_level());
57 size_min_level = MIN2(size_min_level, _alloc_size[t].min_level());
58 size_max_level = MAX2(size_max_level, _alloc_size[t].max_level());
59 }
60
61 out->print_cr("Latencies (in microseconds):");
62 for (int c = lat_min_level; c <= lat_max_level; c++) {
63 out->print("%7d - %7d:", (c == 0) ? 0 : 1 << (c - 1), 1 << c);
64 for (size_t t = 0; t < ShenandoahHeap::_ALLOC_LIMIT; t++) {
65 out->print(SIZE_FORMAT_W(12), _alloc_latency[t].level(c));
66 }
67 out->cr();
68 }
69 out->cr();
70
71 out->print_cr("Sizes (in bytes):");
72 for (int c = size_min_level; c <= size_max_level; c++) {
73 out->print("%7d - %7d:", (c == 0) ? 0 : 1 << (c - 1), 1 << c);
74 for (size_t t = 0; t < ShenandoahHeap::_ALLOC_LIMIT; t++) {
75 out->print(SIZE_FORMAT_W(12), _alloc_size[t].level(c));
76 }
77 out->cr();
78 }
79 out->cr();
80 }
|
15 * 2 along with this work; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19 * or visit www.oracle.com if you need additional information or have any
20 * questions.
21 *
22 */
23
24 #include "precompiled.hpp"
25
26 #include "gc_implementation/shenandoah/shenandoahAllocTracker.hpp"
27 #include "utilities/ostream.hpp"
28
29 void ShenandoahAllocTracker::print_on(outputStream* out) const {
30 out->print_cr("ALLOCATION TRACING");
31 out->print_cr(" These are the slow-path allocations, including TLAB/GCLAB refills, and out-of-TLAB allocations.");
32 out->print_cr(" In-TLAB/GCLAB allocations happen orders of magnitude more frequently, and without delays.");
33 out->cr();
34
35 out->print("%22s", "");
36 for (size_t t = 0; t < ShenandoahHeap::_ALLOC_LIMIT; t++) {
37 out->print("%12s", ShenandoahHeap::alloc_type_to_string(ShenandoahHeap::AllocType(t)));
38 }
39 out->cr();
40
41 out->print_cr("Counts:");
42 out->print("%22s", "#");
43 for (size_t t = 0; t < ShenandoahHeap::_ALLOC_LIMIT; t++) {
44 out->print(SIZE_FORMAT_W(12), _alloc_size[t].num());
45 }
46 out->cr();
47 out->cr();
48
49 // Figure out max and min levels
50 int lat_min_level = +1000;
51 int lat_max_level = -1000;
52 int size_min_level = +1000;
53 int size_max_level = -1000;
54 for (size_t t = 0; t < ShenandoahHeap::_ALLOC_LIMIT; t++) {
55 lat_min_level = MIN2(lat_min_level, _alloc_latency[t].min_level());
56 lat_max_level = MAX2(lat_max_level, _alloc_latency[t].max_level());
57 size_min_level = MIN2(size_min_level, _alloc_size[t].min_level());
58 size_max_level = MAX2(size_max_level, _alloc_size[t].max_level());
59 }
60
61 out->print_cr("Latency summary:");
62 out->print("%22s", "sum, ms:");
63 for (size_t t = 0; t < ShenandoahHeap::_ALLOC_LIMIT; t++) {
64 out->print(SIZE_FORMAT_W(12), _alloc_latency[t].sum() / K);
65 }
66 out->cr();
67 out->cr();
68
69 out->print_cr("Sizes summary:");
70 out->print("%22s", "sum, M:");
71 for (size_t t = 0; t < ShenandoahHeap::_ALLOC_LIMIT; t++) {
72 out->print(SIZE_FORMAT_W(12), _alloc_size[t].sum() * HeapWordSize / M);
73 }
74 out->cr();
75 out->cr();
76
77 out->print_cr("Latency histogram (time in microseconds):");
78 for (int c = lat_min_level; c <= lat_max_level; c++) {
79 out->print("%9d - %9d:", (c == 0) ? 0 : 1 << (c - 1), 1 << c);
80 for (size_t t = 0; t < ShenandoahHeap::_ALLOC_LIMIT; t++) {
81 out->print(SIZE_FORMAT_W(12), _alloc_latency[t].level(c));
82 }
83 out->cr();
84 }
85 out->cr();
86
87 out->print_cr("Sizes histogram (size in bytes):");
88 for (int c = size_min_level; c <= size_max_level; c++) {
89 int l = (c == 0) ? 0 : 1 << (c - 1);
90 int r = 1 << c;
91 out->print("%9d - %9d:", l * HeapWordSize, r * HeapWordSize);
92 for (size_t t = 0; t < ShenandoahHeap::_ALLOC_LIMIT; t++) {
93 out->print(SIZE_FORMAT_W(12), _alloc_size[t].level(c));
94 }
95 out->cr();
96 }
97 out->cr();
98 }
|