From d5a0098e239c2e40a9b5b34629134e5aeed5ad22 Mon Sep 17 00:00:00 2001 From: Ralf Schmelter Date: Mon, 6 Nov 2023 14:30:03 +0100 Subject: [PATCH] Dump only on suitable errors. --- src/hotspot/share/utilities/debug.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/utilities/debug.cpp b/src/hotspot/share/utilities/debug.cpp index 6f8d8ed7c4a..c96f563b102 100644 --- a/src/hotspot/share/utilities/debug.cpp +++ b/src/hotspot/share/utilities/debug.cpp @@ -228,7 +228,9 @@ void report_vm_out_of_memory(const char* file, int line, size_t size, VMErrorType vm_err_type, const char* detail_fmt, ...) { // SapMachine RS 2023-11-03: Check if we should to an emrgency dump for the malloc trace. #if defined(LINUX) || defined(__APPLE__) - sap::MallocStatistic::emergencyDump(); + if ((vm_err_type == OOM_MALLOC_ERROR) || (vm_err_type == OOM_MMAP_ERROR)) { + sap::MallocStatistic::emergencyDump(); + } #endif va_list detail_args;