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

Stefan Karlsson stefan.karlsson at oracle.com
Mon Feb 11 09:52:06 UTC 2019



On 2019-02-11 10:39, Aleksey Shipilev wrote:
> On 2/11/19 9:13 AM, Stefan Karlsson wrote:
>> Please review this patch to remove the broken implementation of CollectedHeap used() and capacity()
>> and instead force all GCs to provide their own implementations.
>>
>> https://cr.openjdk.java.net/~stefank/8218733/webrev.01/
> 
> Looks good.

Thanks!

> 
> 
>> 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?
> 
> Epsilon change looks trivially correct.
> 
> For Shenandoah, I think this would suffice:
> 
>       @Override
>       public long capacity() {
> -       // FIXME
> -       return 0;
> +        return numOfRegions() * ShenandoahHeapRegion.regionSizeBytes();
>       }

I'll incorporate that into the patch.

Thanks,
StefanK

> 
> -Aleksey
> 


More information about the hotspot-gc-dev mailing list