RFR: 8339573: Update CodeCacheSegmentSize and CodeEntryAlignment for ARM

Boris Ulasevich bulasevich at openjdk.org
Tue Sep 10 16:15:05 UTC 2024


On Tue, 10 Sep 2024 15:08:40 GMT, Lutz Schmidt <lucy at openjdk.org> wrote:

>>> During my testing of the mentioned fixes, I never saw such long freelists.
>> 
>> I see the warning every time I run Renaissance benchmarks with the VerifyCodeCache option. Is this a problem and not just a reflection of the fact that the codeheap contains 20K of methods with some holes in between?
>> 
>> 
>> $ ./build/linux-aarch64-server-fastdebug/jdk/bin/java -XX:+VerifyCodeCache -XX:+PrintCodeCache -jar ~/renaissance-jmh-0.14.2-95-gae3b5ce.jar Dotty
>> # Run progress: 0.00% complete, ETA 00:00:00
>> # Fork: 1 of 5
>> # Warmup Iteration   1: 86079.453 ms/op
>> # Warmup Iteration   2: 8212.947 ms/op
>> # Warmup Iteration   3: 5416.496 ms/op
>> # Warmup Iteration   4: 6841.073 ms/op
>> # Warmup Iteration   5: 4248.337 ms/op
>> # Warmup Iteration   6: OpenJDK 64-Bit Server VM warning: CodeHeap: # of free blocks > 10000
>> 3530.697 ms/op
>> # Warmup Iteration   7: 3186.153 ms/op
>> 
>> 
>>> CodeCacheSegmentSize should not be chosen too small to keep memory and processing overhead in check. 64 bytes appears to be a feasible choice.
>> 
>> OK. Thanks!
>
> @bulasevich Thanks for providing the Code Heap Stats.
> 
> At vm shutdown time, when the stats were taken, there is no pathological state in the code heap. 
> 
> - non-profiled nmethods has 70 free blocks, occupying 1033k in total.
> - profiled nmethods has 525 free blocks, occupying 5550k in total.
> - non-nmethods has 5 free blocks, occupying 263k in total. 
> 
> The warning must be triggered by a transient situation, when many methods are removed from the code heap in a short period of time, without significant new method compilations. Eventually, this large number of free blocks will either be reallocated for new compilations or collapse into less, but larger, blocks when even more methods are removed from the code heap. 
> 
> In short: no need to worry.

@RealLucy Good! Thanks for checking!

With this change I do not make things worse. Code Heap Stats numbers fluctuate wildly, but still look good with tuned CodeCacheSegmentSize and CodeEntryAlignment:
- non-profiled nmethods has 53 free blocks, occupying 23k in total.
- profiled nmethods has 199 free blocks, occupying 935k in total.
- non-nmethods has 13 free blocks, occupying 296k in total.

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

PR Comment: https://git.openjdk.org/jdk/pull/20864#issuecomment-2341389827


More information about the hotspot-dev mailing list