RFR: 8279949: JavaThread::_free_handle_block leaks native memory

David Holmes dholmes at openjdk.java.net
Sun Feb 13 01:53:02 UTC 2022


On Sat, 12 Feb 2022 22:07:33 GMT, Leonid Mesnik <lmesnik at openjdk.org> wrote:

> Please review following fix which delete whole list of JNIHandle blocks in JNIHandleBlock::release_block(...).
> Also, I added sanity verification of _pop_frame_link to ensure that there are no leaks there.
> 
> Fix verified with tier1-6. Also, verified that memory leak is not reproduced anymore.
> 
> Thanks to Vladimir I.  for finding exact root cause of problem.

Hi Leonid,

I can't help but think the real problem here is that some code is not managing the active handles correctly. AFAICS we should not end up with a chain of handle blocks when a thread exits! The JVMTI push_frame/pop_frame logic looks a bit messy in that regard - it isn't clear if these are allowed to be unbalanced.

Cheers,
David

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

PR: https://git.openjdk.java.net/jdk/pull/7453


More information about the hotspot-runtime-dev mailing list