RFR: 8273639: tests fail with "assert(_handle_mark_nesting > 1) failed: memory leak: allocating handle outside HandleMark"
Coleen Phillimore
coleenp at openjdk.java.net
Mon Sep 13 14:01:17 UTC 2021
On Mon, 13 Sep 2021 11:57:05 GMT, Per Liden <pliden at openjdk.org> wrote:
> This is a fix for an unintended side-effect of JDK-8273482. The problem is that we need to have a HandleMark on the stack before calling ThreadStackTrace::dump_stack_at_safepoint(). Before JDK-8273482, calls to ThreadStackTrace::dump_stack_at_safepoint() were always done from the VMThread, which always has a HandleMark on the stack before evaluating a VM operation. After JDK-8273482, calls to this function can be made from WorkerThreads, which doesn't always have a HandleMark on its stack. The fix is simple, make sure we have a HandleMark on the stack before calling ThreadStackTrace::dump_stack_at_safepoint().
Looks good and trivial. We should remove the HandleMark mechanism which is a leftover from when Metadata was in Handles. There aren't many places where we have a lot of Handles that would benefit from the optimization of bulk cleanup of Handles and it's really easy to have unnecessary Handles that GC has to process.
-------------
Marked as reviewed by coleenp (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/5492
More information about the hotspot-runtime-dev
mailing list