RFR: 8373102: com/sun/jdi/MethodInvokeWithTraceOnTest.java can fail with ObjectCollectedException when run with a small heap [v2]
Alex Menkov
amenkov at openjdk.org
Fri Dec 5 01:31:01 UTC 2025
On Fri, 5 Dec 2025 01:14:37 GMT, Chris Plummer <cjplummer at openjdk.org> wrote:
>> With JDI tracing enabled, an attempt to trace an event when using SUSPEND_NONE can result in an ObjectCollectedException because the thread is still running and objects that are part of the trace can be collected already. In this case were were dealing with trying to print the thread name for a VirtualThreadEndEvent, and the virtual thread has already exited and been gc'd.
>>
>> Tested by running test case before change (verified failure) and after change (50 runs without a failure). Will also run tier1 and tier5 svc just to be sure.
>
> Chris Plummer has updated the pull request incrementally with one additional commit since the last revision:
>
> better implementation
Marked as reviewed by amenkov (Reviewer).
-------------
PR Review: https://git.openjdk.org/jdk/pull/28666#pullrequestreview-3542748713
More information about the serviceability-dev
mailing list