RFR: 8256811: Delayed/missed jdwp class unloading events [v3]

Zhengyu Gu zgu at openjdk.org
Mon Jun 27 19:24:52 UTC 2022


On Fri, 24 Jun 2022 04:11:24 GMT, Chris Plummer <cjplummer at openjdk.org> wrote:

>> Zhengyu Gu has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 18 additional commits since the last revision:
>> 
>>  - Improve naming and cleanup
>>  - Merge branch 'master' into JDK-8256811-jdi-missing-class-unloading-event
>>  - v4
>>  - v3
>>  - v2
>>  - Merge branch 'master' into JDK-8256811-jdi-missing-class-unloading-event
>>  - Merge branch 'jdi_tmp' into JDK-8256811-jdi-missing-class-unloading-event
>>  - v0
>>  - v2
>>  - v1
>>  - ... and 8 more: https://git.openjdk.org/jdk/compare/7093135d...559b4bf1
>
> src/jdk.jdwp.agent/share/native/libjdwp/eventHandler.c line 966:
> 
>> 964:  */
>> 965: void JNICALL
>> 966: cbTrackingObjectFree(jvmtiEnv* jvmti_env, jlong tag)
> 
> I think it's misleading to have this event handler here since it is handled very differently than all the other events, and with a different `jvmti_env`. Perhaps move this back to classTrack.c, and instead of calling `event_callback()`, call something that just does the parts of `event_callback()` that are really needed for `ObjectFree` (see my comments in `event_callback()` also). What might work bests is to export `synthesizeUnloadEvent()` and just call it from this callback (after relocating it). There's not much of `event_handler()` you need other than the call to `synthesizeUnloadEvent()`.

Moved `cbTrackingObjectFree()` back to `classTrack.c`

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

PR: https://git.openjdk.org/jdk/pull/9168


More information about the serviceability-dev mailing list