On Tue, 18 Oct 2022 17:06:34 GMT, Michael McMahon <[email protected]> wrote:

>> The reference is passed to another thread but should remain alive until that 
>> other thread has terminated - which is ensured by waiting for the executor 
>> to shutdown. What happens here is that the test failed because the other 
>> threads started in this block were keeping the reference alive. I'm using a 
>> reference here because passing `client` to a lambda makes `client` final and 
>> that prevents me from nulling out the `client` variable before calling `gc`. 
>> Using a weak reference solves the issue (since I don't have to null it and 
>> it won't keep the client alive).
>
> I'm still unclear as to why the other threads were keeping the reference 
> alive though?

Okay, I see the comment above about `ReferenceTracker::check(gracedelay)` Never 
mind

-------------

PR: https://git.openjdk.org/jdk/pull/10659

Reply via email to