RFR: 8198509: Move satisfy_failed_metadata_allocation out from CollectorPolicy

Per Liden per.liden at oracle.com
Thu Feb 22 13:50:49 UTC 2018

I'm not too sure about moving this into MetaspaceGC, since Metaspace 
would then make assumptions about how the GC works. I think I'd rather 
keep this in CollectedHeap for now. That's also far from perfect, but 
I'd rather contain the "uglyness" in CollectedHeap for now, and work on 
getting the right abstraction in place later.


On 02/21/2018 02:34 PM, Stefan Karlsson wrote:
> Hi all,
> Please review this patch to move satisfy_failed_metadata_allocation out 
> from CollectorPolicy.
>   http://cr.openjdk.java.net/~stefank/8198509/webrev.01/
>   https://bugs.openjdk.java.net/browse/JDK-8198509
> This is done in preparation for the work to remove CollectorPolicy:
>   https://bugs.openjdk.java.net/browse/JDK-8198505
> The function and the code moves to MetaspaceGC, and CollectedHeap gets a 
> virtual function that calls 
> MetaspaceGC::satisfy_failed_metadata_allocation. MetaspaceGC seems like 
> a good place to put this function, but I'm open for suggestions.
> The current allocation code would then be:
>   Metaspace::allocte
>    virtual CollectedHeap::satisfy_failed_metadata_allocation
>     MetaspaceGC::satisfy_failed_metadata_allocation
> And GCs that want to provide alternative implementations to 
> CollectedHeap::satisfy_failed_metadata_allocation (ZGC for example), 
> could still easily do so.
> Thanks,
> StefanK

More information about the hotspot-gc-dev mailing list