RFR: 8329665: fatal error: memory leak: allocating without ResourceMark [v2]

Aleksey Shipilev shade at openjdk.org
Mon Apr 15 18:47:01 UTC 2024


On Mon, 15 Apr 2024 17:36:26 GMT, Patricio Chilano Mateo <pchilanomate at openjdk.org> wrote:

>> src/hotspot/share/interpreter/oopMapCache.cpp line 184:
>> 
>>> 182: }
>>> 183: 
>>> 184: InterpreterOopMap::~InterpreterOopMap() {
>> 
>> Question: If we remove this opportunistic cleanup of `_bit_mask`, does it mean we might introduce memory inefficiencies in cases where `InterpreterOopMap` is not covered by close-by `ResourceMark`?
>
> In theory yes, although I doubt it is an actual issue because allocating in the resource area for this _bit_mask field is a rare case, and the memory allocated will be a few bytes. But I guess we can keep the eager cleanup just in case since it doesn't hurt.

All right, your call. FWIW, this opportunistic cleanup is ugly, and I am happy to see it go.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18632#discussion_r1566283171


More information about the hotspot-dev mailing list