openjdk-1.8.0/Fix-the-memory-leak-of-MetaspaceAllocationTest.patch
2023-10-20 14:08:12 +08:00

25 lines
764 B
Diff

From 1c55195c050d26f7c3ef53ed8f4ff25f398cfa1e Mon Sep 17 00:00:00 2001
Date: Thu, 19 Oct 2023 11:24:12 +0800
Subject: [PATCH 2/5] Fix the memory leak of MetaspaceAllocationTest
---
hotspot/src/share/vm/memory/metaspace.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/hotspot/src/share/vm/memory/metaspace.cpp b/hotspot/src/share/vm/memory/metaspace.cpp
index 0569500c1..847af1ce9 100644
--- a/hotspot/src/share/vm/memory/metaspace.cpp
+++ b/hotspot/src/share/vm/memory/metaspace.cpp
@@ -5712,6 +5712,8 @@ public:
for (int i = 0; i < NUM_PARALLEL_METASPACES; i ++) {
if (_spaces[i].space != NULL) {
delete _spaces[i].space;
+ }
+ if (_spaces[i].lock != NULL) {
delete _spaces[i].lock;
}
}
--
2.19.1