From c16384386625f0b40bbe3a57572bdd87c59abebd Mon Sep 17 00:00:00 2001 From: "yibo.yl" Date: Thu, 29 Feb 2024 16:35:58 +0800 Subject: [PATCH] 8319876: Reduce memory consumption of VM_ThreadDump::doit --- src/hotspot/share/runtime/vmOperations.cpp | 2 -- src/hotspot/share/services/threadService.cpp | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/hotspot/share/runtime/vmOperations.cpp b/src/hotspot/share/runtime/vmOperations.cpp index fefb96acc7a..9f9a6022fa0 100644 --- a/src/hotspot/share/runtime/vmOperations.cpp +++ b/src/hotspot/share/runtime/vmOperations.cpp @@ -228,7 +228,6 @@ VM_ThreadDump::VM_ThreadDump(ThreadDumpResult* result, _result = result; _num_threads = 0; // 0 indicates all threads _threads = nullptr; - _result = result; _max_depth = max_depth; _with_locked_monitors = with_locked_monitors; _with_locked_synchronizers = with_locked_synchronizers; @@ -243,7 +242,6 @@ VM_ThreadDump::VM_ThreadDump(ThreadDumpResult* result, _result = result; _num_threads = num_threads; _threads = threads; - _result = result; _max_depth = max_depth; _with_locked_monitors = with_locked_monitors; _with_locked_synchronizers = with_locked_synchronizers; diff --git a/src/hotspot/share/services/threadService.cpp b/src/hotspot/share/services/threadService.cpp index bae98f0aadf..0be29ab8c31 100644 --- a/src/hotspot/share/services/threadService.cpp +++ b/src/hotspot/share/services/threadService.cpp @@ -695,7 +695,7 @@ void ThreadStackTrace::dump_stack_at_safepoint(int maxDepth, ObjectMonitorsHasht RegisterMap::UpdateMap::include, RegisterMap::ProcessFrames::include, RegisterMap::WalkContinuation::skip); - + ResourceMark rm; // If full, we want to print both vthread and carrier frames vframe* start_vf = !full && _thread->is_vthread_mounted() ? _thread->carrier_last_java_vframe(®_map)