代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/openjdk-1.8.0 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 0778f0119083ae33aea5ce9b5a1b44f565f45397 Mon Sep 17 00:00:00 2001
Date: Thu, 19 Oct 2023 15:25:43 +0800
Subject: [PATCH 4/5] Add metaspace memory allocation failure validation
---
hotspot/src/share/vm/memory/metaspace.cpp | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/hotspot/src/share/vm/memory/metaspace.cpp b/hotspot/src/share/vm/memory/metaspace.cpp
index 0569500c1..f39ae41f3 100644
--- a/hotspot/src/share/vm/memory/metaspace.cpp
+++ b/hotspot/src/share/vm/memory/metaspace.cpp
@@ -571,7 +571,7 @@ class OccupancyMap : public CHeapObj<mtInternal> {
assert(_map_size * 8 >= num_bits, "sanity");
_map[0] = (uint8_t*) os::malloc(_map_size, mtInternal);
_map[1] = (uint8_t*) os::malloc(_map_size, mtInternal);
- assert(_map[0] != NULL && _map[1] != NULL, "Occupancy Map: allocation failed.");
+ guarantee(_map[0] != NULL && _map[1] != NULL, "Metaspace Occupancy Map: allocation failed.");
memset(_map[1], 0, _map_size);
memset(_map[0], 0, _map_size);
// Sanity test: the first respectively last possible chunk start address in
@@ -918,6 +918,14 @@ void VirtualSpaceNode::print_map(outputStream* st, bool is_class) const {
char* lines[NUM_LINES];
for (int i = 0; i < NUM_LINES; i ++) {
lines[i] = (char*)os::malloc(line_len, mtInternal);
+ // Only print the VirtualSpaceNode memory layout during metaspace OOM.
+ // If it fails,we should return instead of hanging the VM.
+ if (lines[i] == NULL) {
+ for (int j = 0; j < i; j ++) {
+ os::free(lines[j]);
+ }
+ return;
+ }
}
int pos = 0;
const MetaWord* p = bottom();
--
2.19.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。