RFR 9: 8138696 : java.lang.ref.Cleaner - an easy to use alternative to finalization

Vitaly Davidovich vitalyd at gmail.com
Wed Oct 21 15:08:44 UTC 2015


I think this issue is specific to References since they're not treated as
strong roots by GC and therefore do not participate in strong reachability
graphs.

On Wed, Oct 21, 2015 at 10:52 AM, Roger Riggs <Roger.Riggs at oracle.com>
wrote:

> Hi Andrew,
>
> So then is is correct to conclude that the gc does examine fields in
> instances
> still being constructed to determine reachability?
>
> How is that we have gone so long without needing reachabilityFence?
> Or is it just because optimizers have taken so long to get a perfect view
> of reference scope?
>
> Thanks, Roger
>
>
>
> On 10/21/2015 10:45 AM, Andrew Haley wrote:
>
>> On 10/21/2015 02:58 PM, Daniel Fuchs wrote:
>>
>>> I do hope that method parameters are not eagerly gc'ed before
>>> the method returns
>>>
>> They are -- that's what reachabilityFence() is for.  I don't think
>> that constructors have any special rules, and nor should they.
>>
>> Andrew.
>>
>
>



More information about the core-libs-dev mailing list