Question about G1CollectedHeap::print_on()

Thomas Stüfe thomas.stuefe at gmail.com
Wed Oct 11 10:48:19 UTC 2017


Hi all,

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()));
...
}

I am still confused. What is "_hrm.reserved().start() + _hrm.length() +
HeapRegion::GrainWords"?  We add the number of comitted heap regions to the
start address, plus the size of one heap region in words? Sorry, I am not a
GC expert, could someone clarify what this address is?

Another question, while looking further into how g1 commits memory I looked
at G1PageBasedVirtualSpace and it seems to me that there is no clear commit
water mark because pages do not have to be committed sequentially, is that
correct?

Thanks for clarifying!

Kind Regards, Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/hotspot-gc-dev/attachments/20171011/272f0586/attachment.htm>


More information about the hotspot-gc-dev mailing list