Reported on the mailing lists:
---
In a customer error file I found the following output:
Heap:
garbage-first heap total 2592768K, used 1914672K [0x0000000679000000, 0x0000000679104f20, 0x00000007f0000000).
I wonder about the middle address value (0x0000000679104f20). I was assuming this to be the commit watermark. But the value seemed awfully low - just ~1MB beyond the start address of the reserved area. Given that about 4/5th of the heap is in-use, this seemed odd.
Looking at the code:
void G1CollectedHeap::print_on(outputStream* st) const {
....
st->print(" [" PTR_FORMAT ", " PTR_FORMAT ", " PTR_FORMAT ")",
p2i(_hrm.reserved().start()),
>> p2i(_hrm.reserved().start() + _hrm.length() + HeapRegion::GrainWords), <<
p2i(_hrm.reserved().end()));
...
}
---
One problem here is that we don't multiply the number of regions with the region size, but just add them together. Another is that the top/commit watermark doesn't really make sense for G1 since there might be uncommitted regions in the heap.
---
In a customer error file I found the following output:
Heap:
garbage-first heap total 2592768K, used 1914672K [0x0000000679000000, 0x0000000679104f20, 0x00000007f0000000).
I wonder about the middle address value (0x0000000679104f20). I was assuming this to be the commit watermark. But the value seemed awfully low - just ~1MB beyond the start address of the reserved area. Given that about 4/5th of the heap is in-use, this seemed odd.
Looking at the code:
void G1CollectedHeap::print_on(outputStream* st) const {
....
st->print(" [" PTR_FORMAT ", " PTR_FORMAT ", " PTR_FORMAT ")",
p2i(_hrm.reserved().start()),
>> p2i(_hrm.reserved().start() + _hrm.length() + HeapRegion::GrainWords), <<
p2i(_hrm.reserved().end()));
...
}
---
One problem here is that we don't multiply the number of regions with the region size, but just add them together. Another is that the top/commit watermark doesn't really make sense for G1 since there might be uncommitted regions in the heap.
- duplicates
-
JDK-8177959 G1CollectedHeap::print_on prints incorrect capacity
- Resolved