--- old/src/hotspot/share/prims/jvmtiEnv.cpp 2020-06-17 18:12:10.449415987 +0900 +++ new/src/hotspot/share/prims/jvmtiEnv.cpp 2020-06-17 18:12:10.367420294 +0900 @@ -2839,15 +2839,11 @@ // info_ptr - pre-checked for NULL jvmtiError JvmtiEnv::GetObjectMonitorUsage(jobject object, jvmtiMonitorUsage* info_ptr) { - JavaThread* calling_thread = JavaThread::current(); - jvmtiError err = get_object_monitor_usage(calling_thread, object, info_ptr); - if (err == JVMTI_ERROR_THREAD_NOT_SUSPENDED) { - // Some of the critical threads were not suspended. go to a safepoint and try again - VM_GetObjectMonitorUsage op(this, calling_thread, object, info_ptr); - VMThread::execute(&op); - err = op.result(); - } - return err; + // It need to perform at safepoint for gathering stable data + // because monitor owner / waiters might not be suspended. + VM_GetObjectMonitorUsage op(this, JavaThread::current(), object, info_ptr); + VMThread::execute(&op); + return op.result(); } /* end GetObjectMonitorUsage */