On Thu, 6 Nov 2025 21:26:24 GMT, Leonid Mesnik <[email protected]> wrote:
> The problem happens because jvmti events are posted while handling > JvmtiThreadState_lock. The fix just to move > flushing out of lock like it is already done in > `JvmtiEventController::set_user_enabled(..)` method. > > The problem start reproducing after fix for > https://bugs.openjdk.org/browse/JDK-8370732 that replaced GC triggering from > slow and unreliable `ClassUnloader.eatMemory();` to fast and > robust`WhiteBox.fullGC()`. > > The jvmti events posting is not synchronized with enabling/disabling events > and setting callbacks. So even if there are new events appear in the jvmti > tagmap after flushing it is not a bug to don't post them or use new callback > handler. > > Also, it might be makes sense to flush object events before vm_death and post > all deferred events from SerrviceThread queue. > I am going to file separate RFE for this. > Also, I am going to file RFE to replace all GC provoking the `eatMemory()` > calls with `WB.fullGC()` to improve test stability and reduce test execution > time. Marked as reviewed by amenkov (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/28184#pullrequestreview-3430693825
