RFR: 8297638: Memory leak in case of many started-dead threads [v2]

Chris Plummer cjplummer at openjdk.org
Tue Feb 7 02:28:46 UTC 2023


On Tue, 7 Feb 2023 02:21:32 GMT, Serguei Spitsyn <sspitsyn at openjdk.org> wrote:

>> Chris Plummer has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Cleaned up removeUnreachableListeners().
>
> src/jdk.jdi/share/classes/com/sun/tools/jdi/VMState.java line 184:
> 
>> 182:         // We always need to clear the ReferenceQueue
>> 183:         while (listenersReferenceQueue.poll() != null)
>> 184:             ;
> 
> I'm not sure how does this work.
> Do we keep polling if there is any reference object in the queue?
> Can it be an endless loop? Does the poll() remove the reverence object from the queue?

The poll() removes the next object from the queue.

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

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


More information about the serviceability-dev mailing list