RFR: 8284620: CodeBuffer may leak _overflow_arena

Vladimir Kozlov kvn at openjdk.java.net
Mon Apr 11 15:55:41 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

Good.

-------------

Marked as reviewed by kvn (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/8172


More information about the hotspot-compiler-dev mailing list