From 2c41f5adbfcebb057c2ffc8396729bdd1c100079 Mon Sep 17 00:00:00 2001 From: Zhengyu Gu Date: Fri, 17 Jan 2025 13:39:22 +0000 Subject: [PATCH] 8347959: ThreadDumper leaks memory Reviewed-by: amenkov, sspitsyn, shade --- src/hotspot/share/services/heapDumper.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/services/heapDumper.cpp b/src/hotspot/share/services/heapDumper.cpp index 91bcce382f0..2cb32d0500c 100644 --- a/src/hotspot/share/services/heapDumper.cpp +++ b/src/hotspot/share/services/heapDumper.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2023, Alibaba Group Holding Limited. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -1707,6 +1707,12 @@ public: } ThreadDumper(ThreadType thread_type, JavaThread* java_thread, oop thread_oop); + ~ThreadDumper() { + for (int index = 0; index < _frames->length(); index++) { + delete _frames->at(index); + } + delete _frames; + } // affects frame_count void add_oom_frame(Method* oome_constructor) {