Skip to content

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

Closed
MBaesken wants to merge 4 commits intoopenjdk:masterfrom
MBaesken:JDK-8371420
Closed

8371420: Still sporadic failures of gc/TestAlwaysPreTouchBehavior.java#<gcname> on Linux after JDK-8359104#28735
MBaesken wants to merge 4 commits intoopenjdk:masterfrom
MBaesken:JDK-8371420

Conversation

@MBaesken
Copy link
Member

@MBaesken MBaesken commented Dec 10, 2025

After JDK-8359104 where getting RSS was improved, we still see sporadic failures of the test gc/TestAlwaysPreTouchBehavior.java# , 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 .


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8371420: Still sporadic failures of gc/TestAlwaysPreTouchBehavior.java#<gcname> on Linux after JDK-8359104 (Bug - P2)(⚠️ The fixVersion in this issue is [26] but the fixVersion in .jcheck/conf is 27, a new backport will be created when this pr is integrated.)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28735/head:pull/28735
$ git checkout pull/28735

Update a local copy of the PR:
$ git checkout pull/28735
$ git pull https://git.openjdk.org/jdk.git pull/28735/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 28735

View PR using the GUI difftool:
$ git pr show -t 28735

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28735.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 10, 2025

👋 Welcome back mbaesken! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Dec 10, 2025

@MBaesken This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

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

Reviewed-by: mdoerr, ayang

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 140 new commits pushed to the master branch:

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot changed the title JDK-8371420: Still sporadic failures of gc/TestAlwaysPreTouchBehavior.java#<gcname> on Linux after JDK-8359104 8371420: Still sporadic failures of gc/TestAlwaysPreTouchBehavior.java#<gcname> on Linux after JDK-8359104 Dec 10, 2025
@openjdk openjdk bot added the hotspot-gc hotspot-gc-dev@openjdk.org label Dec 10, 2025
@openjdk
Copy link

openjdk bot commented Dec 10, 2025

@MBaesken The following label will be automatically applied to this pull request:

  • hotspot-gc

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the rfr Pull request is ready for review label Dec 10, 2025
@mlbridge
Copy link

mlbridge bot commented Dec 10, 2025

Webrevs

Copy link
Member

@albertnetymk albertnetymk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable. I wonder if it makes sense to extract the loop-body into a method so that the retrying logic are not intertwined with each attempt.

Additionally, there seems a preexisting issue that the else branch of (available > requiredAvailable) should probably also throw SkippedException?

@MBaesken
Copy link
Member Author

Additionally, there seems a preexisting issue that the else branch of (available > requiredAvailable) should probably also throw SkippedException?

Sorry maybe I miss something - where do you want to see such a SkippedException added ?

@albertnetymk
Copy link
Member

... where do you want to see such a SkippedException added ?

The else branch of if (available > requiredAvailable) { is empty. Shouldn't there be a SkippedException in the else branch?

@MBaesken
Copy link
Member Author

... where do you want to see such a SkippedException added ?

The else branch of if (available > requiredAvailable) { is empty. Shouldn't there be a SkippedException in the else branch?

We would continue the for - loop

        // RSS values we get are sometimes somewhat delayed or inaccurate
        for (int iter=0; iter < maxIter; iter++) {

in this case, without a SkippedException. In the original test before this change, we did not throw a SkippedException as well .
On the other hand , if we really run into the else - branch we must have got a small hostAvailableMemory value, so skipping the test might be a good idea because most likely the hostAvailableMemory will not grow in the for loop,

Copy link
Member

@albertnetymk albertnetymk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

if (rss == 0) {
throw new SkippedException("cannot get RSS?");
}
if (available > requiredAvailable) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. Having both skip cases together makes the code better readable and avoids an extra level of curly braces.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, I adjusted the coding.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Dec 19, 2025
@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Dec 19, 2025
Copy link
Contributor

@TheRealMDoerr TheRealMDoerr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Dec 19, 2025
@MBaesken
Copy link
Member Author

Thanks for the reviews !

/integrate

@openjdk
Copy link

openjdk bot commented Dec 19, 2025

Going to push as commit dca55b4.
Since your change was applied there have been 140 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Dec 19, 2025
@openjdk openjdk bot closed this Dec 19, 2025
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Dec 19, 2025
@openjdk
Copy link

openjdk bot commented Dec 19, 2025

@MBaesken Pushed as commit dca55b4.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot-gc hotspot-gc-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

3 participants