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

Patricio Chilano Mateo pchilanomate at openjdk.org
Mon Apr 15 14:53:12 UTC 2024


> There are two places in Loom code that call f.oops_interpreted_do() to process oops in the stackChunk. Although not obvious this method seem to require to have a ResourceMark on scope and there are several contexts where these two are call where we don't have one. The reason why a ResourceMark is needed is because OopMapCache::compute_one_oop_map() might allocate from the resource area if _mask_size is > 4 * BitsPerWord, which depends on the amount of locals + expression stack of the corresponding method. But ~InterpreterOopMap already checks if the _bit_mask was allocated in the resource area and in that case it will free it. So the ResourceMark is not strictly needed except that in debug mode we will actually hit the assert if there is not one in scope when trying to allocate the _bit_mask.
> 
> Thanks,
> Patricio

Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision:

  take ResourceMark out of debug only

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/18632/files
  - new: https://git.openjdk.org/jdk/pull/18632/files/33354c7c..1636b16c

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=18632&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=18632&range=00-01

  Stats: 15 lines in 3 files changed: 1 ins; 14 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/18632.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/18632/head:pull/18632

PR: https://git.openjdk.org/jdk/pull/18632


More information about the hotspot-dev mailing list