Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8189169

G1CollectedHeap::print_on prints wrong value

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • 10
    • 9, 10
    • hotspot
    • gc

      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.

            Unassigned Unassigned
            sjohanss Stefan Johansson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: