Skip to content

Commit d2a4863

Browse files
author
William Kemper
committed
8346690: Shenandoah: Fix log message for end of GC usage report
Reviewed-by: ysr, kdnilsen
1 parent bcb1bda commit d2a4863

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

src/hotspot/share/gc/shenandoah/shenandoahGeneration.cpp

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -205,21 +205,24 @@ void ShenandoahGeneration::log_status(const char *msg) const {
205205

206206
// Not under a lock here, so read each of these once to make sure
207207
// byte size in proper unit and proper unit for byte size are consistent.
208-
size_t v_used = used();
209-
size_t v_used_regions = used_regions_size();
210-
size_t v_soft_max_capacity = soft_max_capacity();
211-
size_t v_max_capacity = max_capacity();
212-
size_t v_available = available();
213-
size_t v_humongous_waste = get_humongous_waste();
214-
LogGcInfo::print("%s: %s generation used: " SIZE_FORMAT "%s, used regions: " SIZE_FORMAT "%s, "
215-
"humongous waste: " SIZE_FORMAT "%s, soft capacity: " SIZE_FORMAT "%s, max capacity: " SIZE_FORMAT "%s, "
216-
"available: " SIZE_FORMAT "%s", msg, name(),
217-
byte_size_in_proper_unit(v_used), proper_unit_for_byte_size(v_used),
218-
byte_size_in_proper_unit(v_used_regions), proper_unit_for_byte_size(v_used_regions),
219-
byte_size_in_proper_unit(v_humongous_waste), proper_unit_for_byte_size(v_humongous_waste),
220-
byte_size_in_proper_unit(v_soft_max_capacity), proper_unit_for_byte_size(v_soft_max_capacity),
221-
byte_size_in_proper_unit(v_max_capacity), proper_unit_for_byte_size(v_max_capacity),
222-
byte_size_in_proper_unit(v_available), proper_unit_for_byte_size(v_available));
208+
const size_t v_used = used();
209+
const size_t v_used_regions = used_regions_size();
210+
const size_t v_soft_max_capacity = soft_max_capacity();
211+
const size_t v_max_capacity = max_capacity();
212+
const size_t v_available = available();
213+
const size_t v_humongous_waste = get_humongous_waste();
214+
215+
const LogGcInfo target;
216+
LogStream ls(target);
217+
ls.print("%s: ", msg);
218+
if (_type != NON_GEN) {
219+
ls.print("%s generation ", name());
220+
}
221+
222+
ls.print_cr("used: " PROPERFMT ", used regions: " PROPERFMT ", humongous waste: " PROPERFMT
223+
", soft capacity: " PROPERFMT ", max capacity: " PROPERFMT ", available: " PROPERFMT,
224+
PROPERFMTARGS(v_used), PROPERFMTARGS(v_used_regions), PROPERFMTARGS(v_humongous_waste),
225+
PROPERFMTARGS(v_soft_max_capacity), PROPERFMTARGS(v_max_capacity), PROPERFMTARGS(v_available));
223226
}
224227

225228
void ShenandoahGeneration::reset_mark_bitmap() {

0 commit comments

Comments
 (0)