RFR: 8284620: CodeBuffer may leak _overflow_arena

Zhengyu Gu zgu at openjdk.java.net
Mon Apr 11 19:07:46 UTC 2022


On Mon, 11 Apr 2022 15:52:15 GMT, Vladimir Kozlov <kvn 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.

Thanks, @vnkozlov

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

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


More information about the hotspot-compiler-dev mailing list