RFR: System.gc() with ExplicitGCInvokesConcurrent should block

Zhengyu Gu zgu at redhat.com
Wed Sep 6 15:56:18 UTC 2017



On 09/06/2017 11:20 AM, Aleksey Shipilev wrote:
> Hi,
> 
> Current ExplicitGCInvokesConcurrent violates the System.gc() contract in this part: "***When control
> returns from the method call,*** the Java Virtual Machine has made a best effort to reclaim space
> from all discarded objects.". To fix it, we need to wait for the end of cycle before returning from
> System.gc() call:
>    http://cr.openjdk.java.net/~shade/shenandoah/concthread-eic-block/webrev.01/

Does it make sense to move flag setting inside mutex lock? it provides 
release-unlock semantics.

Thanks,

-Zhengyu

> 
> Testing: hotspot_gc_shenandoah
> 
> Thanks,
> -Aleksey
> 


More information about the shenandoah-dev mailing list