8153224: Monitor deflation prolong safepoints

Add support for AsyncDeflateIdleMonitors (default true); the async deflation work is performed by the ServiceThread.

Co-authored-by: Carsten Varming <varming@gmail.com>
Reviewed-by: dcubed, rehn, rkennke, cvarming, coleenp, acorn, dholmes, eosterlund
This commit is contained in:
Daniel D. Daugherty 2020-06-01 23:37:14 -04:00
parent 30aa1b0689
commit 00f223e22f
23 changed files with 1496 additions and 250 deletions

View file

@ -41,6 +41,7 @@
#include "runtime/mutexLocker.hpp"
#include "runtime/os.hpp"
#include "runtime/safepoint.hpp"
#include "runtime/synchronizer.hpp"
#include "runtime/thread.inline.hpp"
#include "runtime/vmThread.hpp"
#include "runtime/vmOperations.hpp"
@ -283,6 +284,14 @@ void VMThread::run() {
assert(should_terminate(), "termination flag must be set");
}
if (AsyncDeflateIdleMonitors && log_is_enabled(Info, monitorinflation)) {
// AsyncDeflateIdleMonitors does a special deflation at the final
// safepoint in order to reduce the in-use monitor population that
// is reported by ObjectSynchronizer::log_in_use_monitor_details()
// at VM exit.
ObjectSynchronizer::set_is_special_deflation_requested(true);
}
// 4526887 let VM thread exit at Safepoint
_cur_vm_operation = &halt_op;
SafepointSynchronize::begin();