Skip to content

Commit

Permalink
8313593: Generational ZGC: NMT assert when the heap fails to expand
Browse files Browse the repository at this point in the history
Reviewed-by: eosterlund
Backport-of: 19e2c8c321823c056091e6e9f6c3d0db7ba9ec2b
  • Loading branch information
stefank committed Aug 4, 2023
1 parent fd789db commit 4273487
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/hotspot/share/gc/z/zPhysicalMemory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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)) {
Expand Down

0 comments on commit 4273487

Please sign in to comment.