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

SA: CollectedHeap provides broken implementation for used() and capacity()

    XMLWordPrintable

Details

    • b09

    Backports

      Description

        The CollectedHeap class provides concrete (broken) implementations for used() and capacity(). I propose that we make these functions abstract to force the sub classes to provide a correct implementation.

        This was found while running serviceability/sa/TestHeapDumpForLargeArray.java on an experimental implementation of heap dumping in ZGC.

        ZGC didn't provide a ZCollectedHeap.used() function and CollectedHeap.used() was used instead at:
                // Check weather we should dump the heap as segments
                useSegmentedHeapDump = vm.getUniverse().heap().used() > HPROF_SEGMENTED_HEAP_DUMP_THRESHOLD;

        Because of this we incorrectly did not use segmented heap dumps, and therefore overflowed later in the code.

        Attachments

          Issue Links

            Activity

              People

                stefank Stefan Karlsson
                stefank Stefan Karlsson
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: