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

Aleksey Shipilev shade at redhat.com
Mon Feb 11 09:39:33 UTC 2019

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.

> 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:

     public long capacity() {
-       // FIXME
-       return 0;
+        return numOfRegions() * ShenandoahHeapRegion.regionSizeBytes();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://mail.openjdk.java.net/pipermail/hotspot-gc-dev/attachments/20190211/ad7b16bb/signature.asc>

More information about the hotspot-gc-dev mailing list