From af39a810d7740cf41fbd0c9467f8fbcafad7935d Mon Sep 17 00:00:00 2001 From: Zhengyu Gu Date: Thu, 16 Nov 2017 20:21:11 -0500 Subject: [PATCH] 8190357: NMT: Include metadata information in NMT final report when PrintNMTStatistics is on Include metadata information in NMT final report Reviewed-by: adinn, stuefe --- src/hotspot/share/services/memTracker.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/hotspot/share/services/memTracker.cpp b/src/hotspot/share/services/memTracker.cpp index c930da6a439..1417d9c96aa 100644 --- a/src/hotspot/share/services/memTracker.cpp +++ b/src/hotspot/share/services/memTracker.cpp @@ -25,11 +25,14 @@ #include "jvm.h" #include "runtime/mutex.hpp" +#include "runtime/vmThread.hpp" +#include "runtime/vm_operations.hpp" #include "services/memBaseline.hpp" #include "services/memReporter.hpp" #include "services/mallocTracker.inline.hpp" #include "services/memTracker.hpp" #include "utilities/defaultStream.hpp" +#include "utilities/vmError.hpp" #ifdef SOLARIS volatile bool NMT_stack_walkable = false; @@ -173,6 +176,11 @@ void MemTracker::report(bool summary_only, outputStream* output) { } else { MemDetailReporter rpt(baseline, output); rpt.report(); + + // Metadata reporting requires a safepoint, so avoid it if VM is not in good state. + assert(!VMError::fatal_error_in_progress(), "Do not report metadata in error report"); + VM_PrintMetadata vmop(output, K); + VMThread::execute(&vmop); } } }