This is a regression that has been introduced by the fix of: [8256811](https://bugs.openjdk.org/browse/JDK-8256811): Delayed/missed jdwp class unloading events
This is the relevant comment from Zhengyu: It is caused by https://bugs.openjdk.org/browse/JDK-8256811 as JvmtiExport::post_object_free() call does not expect under any lock. I think we can move following code outside of lock, as flush_obect_free_events() races ServiceThread's JvmtiTagMap::flush_all_object_free_events() call anyway. if (event_type == JVMTI_EVENT_OBJECT_FREE) { flush_object_free_events(env); } The fix is as was suggested by Zhengyu above. I was not able to reproduce JCK and nsk.jvmti test failures mentioned in the bug report. However, this fix should address the problem as it moves the call to `flush_object_free_events(env)` out of a critical section with a lock. ------------- Commit messages: - 8290908: misc tests fail: assert(->owns_locks()) failed: must release all locks when leaving VM Changes: https://git.openjdk.org/jdk/pull/9699/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=9699&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8290908 Stats: 8 lines in 1 file changed: 4 ins; 4 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/9699.diff Fetch: git fetch https://git.openjdk.org/jdk pull/9699/head:pull/9699 PR: https://git.openjdk.org/jdk/pull/9699