Skip to content

Commit ae45b94

Browse files
author
William Kemper
committedDec 20, 2024
8346690: Shenandoah: Fix log message for end of GC usage report
Backport-of: d2a48634b872b65668b57d3975f805277ae96f83
1 parent 48cd85f commit ae45b94

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed
 

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

+18-15
Original file line numberDiff line numberDiff line change
@@ -204,21 +204,24 @@ void ShenandoahGeneration::log_status(const char *msg) const {
204204

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

224227
void ShenandoahGeneration::reset_mark_bitmap() {

0 commit comments

Comments
 (0)
Please sign in to comment.