1 Star 0 Fork 81

Alex Gao/openjdk-1.8.0

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
enhance-java-heap-oom-err-log.patch 1.43 KB
一键复制 编辑 原始数据 按行查看 历史
wanghao 提交于 2023-08-01 15:30 . I7PICQ: upgrade to jdk8u382-ga
From 2e7ce3a50aca6b0633e2fb7b2d0ef3c9e7b6ebc4 Mon Sep 17 00:00:00 2001
Date: Thu, 27 Jul 2023 19:53:53 +0800
Subject: [PATCH] [Huawei]enhance java-heap-oom err log
---
.../src/share/vm/gc_interface/collectedHeap.inline.hpp | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp b/hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp
index 8ed2df96a..ab4827a9b 100644
--- a/hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp
+++ b/hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp
@@ -156,8 +156,16 @@ HeapWord* CollectedHeap::common_mem_allocate_noinit(KlassHandle klass, size_t si
if (!gc_overhead_limit_was_exceeded) {
+ ResourceMark rm;
+ tty->print_cr("OOM caused by java heap space occurred, allocate size: %zu bytes, type: %s", size * HeapWordSize, klass->signature_name());
+ Universe::heap()->print_on(tty);
+
+ if (THREAD->is_Java_thread()) {
+ tty->print_cr("current stack trace:");
+ ((JavaThread*)THREAD)->print_stack_on(tty);
+ }
// -XX:+HeapDumpOnOutOfMemoryError and -XX:OnOutOfMemoryError support
- report_java_out_of_memory("Java heap space");
+ report_java_out_of_memory(err_msg("Java heap space, allocate size: %zu bytes, type: %s", size * HeapWordSize, klass->signature_name()));
if (JvmtiExport::should_post_resource_exhausted()) {
JvmtiExport::post_resource_exhausted(
--
2.19.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/gaoxiang90/openjdk-1.8.0.git
git@gitee.com:gaoxiang90/openjdk-1.8.0.git
gaoxiang90
openjdk-1.8.0
openjdk-1.8.0
master

搜索帮助