changeset 55423:b9f030844be4

8220591: ZGC: Don't delay reclaimation of ZVirtualMemory Reviewed-by: stefank, eosterlund
author pliden
date Mon, 18 Mar 2019 11:50:39 +0100
parents 84295bd6d359
children d0d26fc836dd
files src/hotspot/share/gc/z/zPageAllocator.cpp
diffstat 1 files changed, 3 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/gc/z/zPageAllocator.cpp	Mon Mar 18 11:50:39 2019 +0100
+++ b/src/hotspot/share/gc/z/zPageAllocator.cpp	Mon Mar 18 11:50:39 2019 +0100
@@ -253,12 +253,6 @@
 void ZPageAllocator::destroy_page(ZPage* page) {
   assert(page->is_detached(), "Invalid page state");
 
-  // Free virtual memory
-  {
-    ZLocker<ZLock> locker(&_lock);
-    _virtual.free(page->virtual_memory());
-  }
-
   delete page;
 }
 
@@ -453,6 +447,9 @@
 void ZPageAllocator::detach_memory(const ZVirtualMemory& vmem, ZPhysicalMemory& pmem) {
   const uintptr_t addr = vmem.start();
 
+  // Free virtual memory
+  _virtual.free(vmem);
+
   // Unmap physical memory
   _physical.unmap(pmem, addr);