8255848: -Xlog:gc+heap+exit shows "used 0K"

Reviewed-by: tschatzl, ayang
This commit is contained in:
Stefan Johansson 2020-11-05 08:13:40 +00:00
parent eb85b8da32
commit 397972ebf3

@ -2437,10 +2437,11 @@ void G1CollectedHeap::print_heap_regions() const {
}
void G1CollectedHeap::print_on(outputStream* st) const {
size_t heap_used = Heap_lock->owned_by_self() ? used() : used_unlocked();
st->print(" %-20s", "garbage-first heap");
if (_hrm != NULL) {
st->print(" total " SIZE_FORMAT "K, used " SIZE_FORMAT "K",
capacity()/K, used_unlocked()/K);
capacity()/K, heap_used/K);
st->print(" [" PTR_FORMAT ", " PTR_FORMAT ")",
p2i(_hrm->reserved().start()),
p2i(_hrm->reserved().end()));