RFR: 8369219: JNI::RegisterNatives causes a memory leak in CodeCache [v6]

Francesco Andreuzzi fandreuzzi at openjdk.org
Fri Oct 24 14:05:09 UTC 2025


On Fri, 24 Oct 2025 13:39:19 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> Francesco Andreuzzi has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 15 additional commits since the last revision:
>> 
>>  - cc
>>  - Merge branch 'master' into JDK-8369219
>>  - nn
>>  - update foundOne
>>  - fix summary
>>  - nn
>>  - Merge branch 'master' into JDK-8369219
>>  - trigger
>>  - nn
>>  - othervm
>>  - ... and 5 more: https://git.openjdk.org/jdk/compare/4e995ea0...b6d94cf8
>
> test/hotspot/jtreg/gc/NativeWrapperCollection/NativeWrapperCollection.java line 62:
> 
>> 60:         WB.enqueueMethodForCompilation(method, 1 /* compLevel */);
>> 61:         while (WB.isMethodQueuedForCompilation(method)) {
>> 62:             Thread.onSpinWait();
> 
> We are just waiting for compilation here. It is counter-productive to wait with a busy-loop. Insert a sleep for ~10...100ms instead. Same thing for the loop below.

Thanks, that sounds reasonable. I got this pattern from another test, but it looks counterproductive here indeed.

5d0c70562614c5a3cd3391f5191bf60c5b51e82c

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27742#discussion_r2460634429


More information about the hotspot-compiler-dev mailing list