aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Karlsson <stefank@openjdk.org>2023-08-04 11:33:06 +0000
committerVitaly Provodin <vitaly.provodin@jetbrains.com>2023-08-12 06:47:31 +0700
commitc702e89c52bd660eb4e95ebcfdd986bbb8c2a525 (patch)
tree84ace843b109861ff61ec277697ba8a1f10c0740
parent7159ccf83c000acfe1848f7547e59a3496300d95 (diff)
downloadJetBrainsRuntime-c702e89c52bd660eb4e95ebcfdd986bbb8c2a525.tar.gz
8313593: Generational ZGC: NMT assert when the heap fails to expand
Reviewed-by: eosterlund Backport-of: 19e2c8c321823c056091e6e9f6c3d0db7ba9ec2b
-rw-r--r--src/hotspot/share/gc/z/zPhysicalMemory.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/hotspot/share/gc/z/zPhysicalMemory.cpp b/src/hotspot/share/gc/z/zPhysicalMemory.cpp
index c0e0e837c9c..924bc729124 100644
--- a/src/hotspot/share/gc/z/zPhysicalMemory.cpp
+++ b/src/hotspot/share/gc/z/zPhysicalMemory.cpp
@@ -309,7 +309,9 @@ bool ZPhysicalMemoryManager::commit(ZPhysicalMemory& pmem) {
const size_t committed = _backing.commit(segment.start(), segment.size());
// Register with NMT
- ZNMT::commit(segment.start(), committed);
+ if (committed > 0) {
+ ZNMT::commit(segment.start(), committed);
+ }
// Register committed segment
if (!pmem.commit_segment(i, committed)) {
@@ -335,7 +337,9 @@ bool ZPhysicalMemoryManager::uncommit(ZPhysicalMemory& pmem) {
const size_t uncommitted = _backing.uncommit(segment.start(), segment.size());
// Unregister with NMT
- ZNMT::uncommit(segment.start(), uncommitted);
+ if (uncommitted > 0) {
+ ZNMT::uncommit(segment.start(), uncommitted);
+ }
// Deregister uncommitted segment
if (!pmem.uncommit_segment(i, uncommitted)) {