RFR: 8371420: Still sporadic failures of gc/TestAlwaysPreTouchBehavior.java#<gcname> on Linux after JDK-8359104 [v3]

Albert Mingkun Yang ayang at openjdk.org
Fri Dec 19 09:46:36 UTC 2025


On Fri, 19 Dec 2025 09:27:42 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

>> After [JDK-8359104](https://bugs.openjdk.org/browse/JDK-8359104) where getting RSS was improved, we still see sporadic failures of the test gc/TestAlwaysPreTouchBehavior.java#<gcname> , for different gcs.
>> E.g. gc/TestAlwaysPreTouchBehavior.java#Epsilon (with -Xlog:os=debug added for more output) 
>> 
>> 
>> ----------System.err:(13/1278)----------
>> java.lang.RuntimeException: RSS of this process(24465408b) should be bigger than or equal to heap size(268435456b) (available memory: 16295006208). On Linux Kernel < 4.14 RSS can be inaccurate: expected 24465408 > 268435456
>> 
>> 
>> Looks like the RSS values we get are somewhat delayed/inaccurate .
>
> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Add SkippedException for too small host memory

Some local variables are loop-invariant, e.g. `heapSize`. I wonder if extracting them out, thus minimizing the loop-body, can make the whole loop more readable. A bit subjective; up to you.

test/hotspot/jtreg/gc/TestAlwaysPreTouchBehavior.java line 159:

> 157:                 throw new SkippedException("cannot get RSS?");
> 158:             }
> 159:             if (available > requiredAvailable) {

I'd suggest inverting the condition to "early-throw" for uninteresting cases, like above.

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

Marked as reviewed by ayang (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/28735#pullrequestreview-3597768437
PR Review Comment: https://git.openjdk.org/jdk/pull/28735#discussion_r2634376814


More information about the hotspot-gc-dev mailing list