RFR: System.gc() with ExplicitGCInvokesConcurrent should block
Zhengyu Gu
zgu at redhat.com
Wed Sep 6 16:03:31 UTC 2017
On 09/06/2017 11:58 AM, Aleksey Shipilev wrote:
> On 09/06/2017 05:56 PM, Zhengyu Gu wrote:
>>
>>
>> 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.
>
> Nope, because the is_conc_gc_requested() is lock-free.
Yes, but an acquire in is_conc_gc_requested should be sufficient, no?
-Zhengyu
>
> -Aleksey
>
More information about the shenandoah-dev
mailing list