-
Enhancement
-
Resolution: Fixed
-
P4
-
25
-
b21
The first ifdef in the code below (from compilationMemoryStatistic.cpp) should be COMPILER1 instead of COMPILER 2. Not a bug, just extra code included when building with C2 but not C1.
#ifdef COMPILER2
// C1: print allocations broken down by arena types
if (_comp_type == CompilerType::compiler_c1) {
st->print("[");
size_t sums[arena_tag_max];
_counters_at_global_peak.summarize(sums);
bool print_comma = false;
for (int i = 0; i < arena_tag_max; i++) {
if (sums[i] > 0) {
if (print_comma) {
st->print_raw(", ");
}
st->print("%s %zu", Arena::tag_name[i], sums[i]);
print_comma = true;
}
}
st->print_cr("]");
}
#endif // COMPILER1
#ifdef COMPILER2
// C2: print counters and timeline on multiple lines, indented
if (_comp_type == CompilerType::compiler_c2) {
streamIndentor si(st, 4);
st->cr();
st->print_cr("--- Arena Usage by Arena Type and compilation phase, at arena usage peak of %zu ---", _peak);
{
streamIndentor si(st, 4);
_counters_at_global_peak.print_on(st);
}
st->print_cr("--- Allocation timelime by phase ---");
{
streamIndentor si(st, 4);
_timeline.print_on(st);
}
st->print_cr("---");
}
#endif
#ifdef COMPILER2
// C1: print allocations broken down by arena types
if (_comp_type == CompilerType::compiler_c1) {
st->print("[");
size_t sums[arena_tag_max];
_counters_at_global_peak.summarize(sums);
bool print_comma = false;
for (int i = 0; i < arena_tag_max; i++) {
if (sums[i] > 0) {
if (print_comma) {
st->print_raw(", ");
}
st->print("%s %zu", Arena::tag_name[i], sums[i]);
print_comma = true;
}
}
st->print_cr("]");
}
#endif // COMPILER1
#ifdef COMPILER2
// C2: print counters and timeline on multiple lines, indented
if (_comp_type == CompilerType::compiler_c2) {
streamIndentor si(st, 4);
st->cr();
st->print_cr("--- Arena Usage by Arena Type and compilation phase, at arena usage peak of %zu ---", _peak);
{
streamIndentor si(st, 4);
_counters_at_global_peak.print_on(st);
}
st->print_cr("--- Allocation timelime by phase ---");
{
streamIndentor si(st, 4);
_timeline.print_on(st);
}
st->print_cr("---");
}
#endif
- caused by
-
JDK-8344009 Improve compiler memory statistics
-
- Resolved
-
- links to
-
Commit(master) openjdk/jdk/66358fa2
-
Review(master) openjdk/jdk/24876