On Sat, 1 Oct 2022 01:12:52 GMT, Chris Plummer <cjplum...@openjdk.org> wrote:
> The bug is due to the debug agent still having a reference to one of the > classes when the full GC is issued by the debuggee, thus keeping the classes > loaded. The debug agent it about to free the reference, but doesn't do it > quite soon enough, and then it is blocked from freeing it by the full GC. It > does free it after the full GC, but by then it is too late, and the full GC > has already failed to unload all the classes. > > The debug agent class reference is coming from the ClassPrepareEvent that is > sent for the last class loaded. The event has been sent to the debugger and > the debug agent is about to free the reference, but the debuggee main thread > has already resumed and gets to the full GC first. Adding a short delay in > the debuggee main thread allows the debug agent to finish freeing the > reference before the full GC is done. test/jdk/com/sun/jdi/ClassUnloadEventTest.java line 121: > 119: > 120: // Do a short delay to make sure all ClassUnloadEvents have been > sent > 121: // before VMDeathEvent is genareated. Existing typo: genareated ------------- PR: https://git.openjdk.org/jdk/pull/10519