RFR: 8336692: Redo fix for JDK-8284620

Dean Long dlong at openjdk.org
Sat Jul 20 02:25:37 UTC 2024


On Thu, 18 Jul 2024 14:39:24 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

> [JDK-8284620](https://bugs.openjdk.org/browse/JDK-8284620) tried to fix memory leak for `CodeBuffer::_overflow_arena` but I think the fix was incorrect. It created an issue when CodeBuffer expanded and we try to use information in `CodeBuffer::_overflow_arena` but it will be nulled.
> 
> CodeBuffer expansion affect only data (addresses and descriptors) associated with code and data in CodeCache where we create new CodeBlob with bigger space for code. CodeBuffer's data allocated in C heap is not affected and should not be updated.
> 
> The original code in [CodeBuffer::take_over_code_from()](https://github.com/openjdk/jdk/blob/master/src/hotspot/share/asm/codeBuffer.cpp#L976) incorrectly copied `_overflow_arena` from [new CodeBuffer `cb`](https://github.com/openjdk/jdk/blob/master/src/hotspot/share/asm/codeBuffer.cpp#L937) where it is NULL and as result we lost pointer to allocated space. Which was the reason for memory leak.
> 
> The fix is to remove that old line in `CodeBuffer::take_over_code_from()` and undo JDK-8284620) fix.
> 
> Tested tier1-3,stress,xcomp.

Marked as reviewed by dlong (Reviewer).

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

PR Review: https://git.openjdk.org/jdk/pull/20236#pullrequestreview-2189674404


More information about the hotspot-compiler-dev mailing list