8347959: ThreadDumper leaks memory

Reviewed-by: amenkov, sspitsyn, shade
This commit is contained in:
Zhengyu Gu 2025-01-17 13:39:22 +00:00
parent 15e06b6186
commit 2c41f5adbf

View File

@ -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) {