--- old/src/hotspot/share/prims/jvm.cpp 2019-03-22 16:30:32.621896906 -0400 +++ new/src/hotspot/share/prims/jvm.cpp 2019-03-22 16:30:32.181896913 -0400 @@ -71,6 +71,7 @@ #include "runtime/os.inline.hpp" #include "runtime/perfData.hpp" #include "runtime/reflection.hpp" +#include "runtime/synchronizer.hpp" #include "runtime/thread.inline.hpp" #include "runtime/threadSMR.hpp" #include "runtime/vframe.inline.hpp" @@ -482,6 +483,11 @@ JVM_ENTRY_NO_ENV(void, JVM_GC(void)) JVMWrapper("JVM_GC"); if (!DisableExplicitGC) { + if (AsyncDeflateIdleMonitors) { + // AsyncDeflateIdleMonitors needs to know when System.gc() is + // called so any special clean up can be done at a safepoint. + ObjectSynchronizer::set_is_cleanup_requested(true); + } Universe::heap()->collect(GCCause::_java_lang_system_gc); } JVM_END