Skip to content

Commit 296780c

Browse files
committedNov 15, 2021
8276983: Small fixes to DumpAllocStat::print_stats
Reviewed-by: dholmes, iklam
1 parent 8c5f030 commit 296780c

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed
 

‎src/hotspot/share/cds/dumpAllocStats.cpp

+5-10
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,6 @@ void DumpAllocStats::print_stats(int ro_all, int rw_all) {
4242
_counts[RO][StringBucketType] = _string_stats.bucket_count;
4343
_bytes [RO][StringBucketType] = _string_stats.bucket_bytes;
4444

45-
// prevent divide-by-zero
46-
if (ro_all < 1) {
47-
ro_all = 1;
48-
}
49-
if (rw_all < 1) {
50-
rw_all = 1;
51-
}
52-
5345
int all_ro_count = 0;
5446
int all_ro_bytes = 0;
5547
int all_rw_count = 0;
@@ -102,8 +94,11 @@ void DumpAllocStats::print_stats(int ro_all, int rw_all) {
10294
all_rw_count, all_rw_bytes, all_rw_perc,
10395
all_count, all_bytes, all_perc);
10496

105-
assert(all_ro_bytes == ro_all, "everything should have been counted");
106-
assert(all_rw_bytes == rw_all, "everything should have been counted");
97+
msg.flush();
98+
99+
assert(all_ro_bytes == ro_all && all_rw_bytes == rw_all,
100+
"everything should have been counted (used/counted: ro %d/%d, rw %d/%d",
101+
ro_all, all_ro_bytes, rw_all, all_rw_bytes);
107102

108103
#undef fmt_stats
109104
}

0 commit comments

Comments
 (0)
Please sign in to comment.