< prev index next >
src/hotspot/share/gc/z/zUncommitter.cpp
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
@@ -54,21 +54,23 @@
}
void ZUncommitter::run_service() {
for (;;) {
// Try uncommit unused memory
- const uint64_t timeout = ZHeap::heap()->uncommit(ZUncommitDelay);
-
- log_trace(gc, heap)("Uncommit Timeout: " UINT64_FORMAT "s", timeout);
+ const uint64_t timeout = ZHeap::heap()->uncommit();
// Idle until next attempt
if (!idle(timeout)) {
return;
}
}
}
void ZUncommitter::stop_service() {
+ // Cancel any ongoing uncommit
+ ZHeap::heap()->uncommit_cancel();
+
+ // Signal thread to stop
MonitorLocker ml(&_monitor, Monitor::_no_safepoint_check_flag);
_stop = true;
ml.notify();
}
< prev index next >