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

G1 Old Gen MemoryPool CollectionUsage.used values don't reflect mixed GC results

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 11
    • 8u144, 9.0.1, 10
    • hotspot
    • gc
    • b19
    • generic
    • generic

        The specification for the MemoryPoolMXBean.CollectionUsage says that it "Returns the memory usage after the Java virtual machine most recently expended effort in recycling unused objects in this memory pool." For the two G1 MemoryPools (G1 Young Gen and G1 Old Gen), CollectionUsage.used does not reflect the effect of mixed GCs on G1 Old Gen. For G1 Old Gen, CollectionUsage.used reflects only the effect of a full collection. Reproducer attached.

        A fix is to (1) add the G1 Old Gen MemoryPool to the G1 Young Gen GarbageCollector, and (2) inform the latter when a mixed GC occurs so it can save the state of the G1 Old Gen MemoryPool.

        At Amazon, we find MemoryPool.CollectionUsage to be a more useful metric than MemoryPool.Usage because the former is a much better measure of long term heap occupancy than the latter.

          1. GcTest.java
            1 kB
          2. org.tar.gz
            350 kB

              phh Paul Hohensee
              phh Paul Hohensee
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: