RFR: 8284620: CodeBuffer may leak _overflow_arena
Zhengyu Gu
zgu at openjdk.java.net
Mon Apr 11 12:56:34 UTC 2022
On Mon, 11 Apr 2022 06:43:12 GMT, Tobias Hartmann <thartmann 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.
Thanks, @TobiHartmann
-------------
PR: https://git.openjdk.java.net/jdk/pull/8172
More information about the hotspot-compiler-dev
mailing list