Integrated: 8336692: Redo fix for JDK-8284620

Vladimir Kozlov kvn at openjdk.org
Sat Jul 20 15:44:36 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.

This pull request has now been integrated.

Changeset: c5b7af73
Author:    Vladimir Kozlov <kvn at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/c5b7af73d07f7458e970f5752eb75640562ddc7b
Stats:     6 lines in 1 file changed: 2 ins; 3 del; 1 mod

8336692: Redo fix for JDK-8284620

Reviewed-by: dlong

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

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


More information about the hotspot-compiler-dev mailing list