RFR: 8218733: SA: CollectedHeap provides broken implementation for used() and capacity()
erik.osterlund at oracle.com
Thu Feb 14 08:38:07 UTC 2019
On 2019-02-11 09:13, Stefan Karlsson wrote:
> Hi all,
> Please review this patch to remove the broken implementation of
> CollectedHeap used() and capacity() and instead force all GCs to provide
> their own implementations.
> 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() >
> Because of this we incorrectly did not use segmented heap dumps, and
> therefore overflowed later in the code
> Aleksey and Roman,
> Could you verify that the implementation for Epsilon is correct? I also
> haven't implemented capacity for Shenandoah, as the information isn't
> trivially available in the ShenandoahHeap SA class. Do you want to fix
> it as part of this patch, or should I create a separate RFE for Shenandoah?
More information about the hotspot-gc-dev