On Mon, 27 Jun 2022 21:28:25 GMT, Chris Plummer <[email protected]> wrote:
>> Zhengyu Gu has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> Renamed eventHandler_synthesizeUnloadEvent
>
> src/jdk.jdwp.agent/share/native/libjdwp/eventHandler.c line 1714:
>
>> 1712: if (node->ei == EI_GC_FINISH) {
>> 1713: classTrack_activate(getEnv());
>> 1714: }
>
> This looked a bit strange to me w.r.t. when we activate class tracking, so I
> looked into it. It turns out that when the debugger sends a request for
> CLASS_UNLOAD events, we convert it to EI_GC_FINISH and install a handler for
> it (and activate class tracking as you see in the above code). Activating
> doesn't do much. In fact it's not even where the ObjectFree events are
> enabled. This is done unconditionally in `classTrack_initialize()`, which is
> called whenever the debug agent is initialized. This means we always have
> the ObjectFree events enabled, even when the debugger has not requested
> CLASS_LOAD events. This seems like a bit of a performance issue. Maybe
> `classTrack_activate()` is where we should be enabling ObjectFree events. We
> should probably file a separate CR to have this fixed.
Filed [JDK-8289318](https://bugs.openjdk.org/browse/JDK-8289318)
-------------
PR: https://git.openjdk.org/jdk/pull/9168