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

Shenandoah misreports "committed" size in MemoryMXBean

XMLWordPrintable

    • gc
    • b10

        This is reported by Ruslan Synytsky. He noticed that Shenandoah misreports "committed" size via MemoryMXBean. On his test case, it looks like this:

        [27.908s][info][gc] Uncommitted 1040M. Heap: 2048M reserved, 5M committed, 4M used
        11:04:43 -> Init: 32M Used: 4M Committed: 2048M Max: 2048M

        The first line is report by Shenandoah itself. The second line is the data from MXBean. So, while only 5M is actually committed, MXBean reports 2048M as committed.

        This is caused in jdk12+ by clash with memory usage accounting redone in JDK-8207200. Shenandoah always reports capacity() as max_capacity(), because it "resizes" the heap by committing regions as needed. This makes default implementation in CollectedHeap::memory_usage() believe all memory is committed by Shenandoah at all times.

              shade Aleksey Shipilev
              shade Aleksey Shipilev
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: