RFR: 8284620: CodeBuffer may leak _overflow_arena
Tobias Hartmann
thartmann at openjdk.java.net
Mon Apr 11 06:46:30 UTC 2022
On Sat, 9 Apr 2022 16:01:40 GMT, Zhengyu Gu <zgu at openjdk.org> wrote:
> `CodeBuffer` is declared as `StackObj`, but it also has `ResourceObj` style `new operator`, to complicate thing further more, it has _overflow_arena that is C Heap allocated.
>
> When Stack allocated `CodeBuffer` owns `_overflow_arena`, it works fine, because its destructor frees `_overflow_arena`. But if resource allocated `CodeBuffer` owns `_overflow_arena`, the arena is leaked, because its destructor is never called.
>
> Test:
> - [x] hotspot_compiler on Linux x86_64
Looks reasonable to me. Another review would be good.
-------------
Marked as reviewed by thartmann (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/8172
More information about the hotspot-compiler-dev
mailing list