8331185: Enable compiler memory limits in debug builds#18969
8331185: Enable compiler memory limits in debug builds#18969tstuefe wants to merge 19 commits intoopenjdk:masterfrom
Conversation
|
👋 Welcome back stuefe! A progress list of the required criteria for merging this PR into |
|
@tstuefe 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: 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 9 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
Webrevs
|
|
I submitted our testing. Why you did not merge your latest JDK-8330625 change? Patch was applied with offsets. So I will test latest JDK. |
| * Copyright (c) 2023, 2024 Red Hat, Inc. All rights reserved. | ||
| * Copyright (c) 2023, 2024 Oracle and/or its affiliates. All rights reserved. |
There was a problem hiding this comment.
Missing comma , after second year. Files header verifier failed for both test files.
|
Looks like Register Allocator eats memory. |
|
There also few closed tests which failed with |
|
Closed test passed with |
|
@vnkozlov How do you want to handle this? Are these memory usage numbers pathological or normal? Should I increase the general limit to 1200M? Alternatively, we can also just run failing the test with a higher memory limit. |
The closed failed test has very long chain of lambda forms and I don't think memory consumption is pathological. May be something could be done to improve it (as enhancement RFE) but it is not urgent. I will help you with increase limit for it. I did not check which limit will allow to pass failed open tests. I will ask you to investigate and increase limit for them for now and file bugs to investigate the cause. I also need to run later tiers (I ran only up to tier5) before integration. If I find more failing cases we may consider increase default limit. |
|
I did not find any other failures in tier6-9. So let's adjust limit and file bugs for failed tests I found before. And keep default limit 1Gb. |
Ah forgot. Sorry. Thanks for testing with the latest head. |
|
@vnkozlov Opened a follow up issue for |
|
@vnkozlov ... but I was unable to reproduce the problem with I tried to reproduce it on both MacOS m1, and on a Raspberry 4 with 64bit linux. The annoying part is that when we assert the memlimit during usage, we do not know how large the limit would have been had we continued. We could add a third option to the |
|
Opened a bug to track the memory limit break in compiler/loopopts/TestDeepGraphVerifyIterativeGVN.java. Since I cannot reproduce it, someone at Oracle should look at this: https://bugs.openjdk.org/browse/JDK-8331295 |
…veGVN.java until JDK-8331295 is fixed
|
Thank you, @tstuefe, for filing these bugs. One additional thing I noticed is that we don't produce compilation replay file (its size is 0) for such failures. Can you look why is that? |
|
|
@tstuefe this pull request can not be integrated into git checkout compiler-default-limit
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push |
| // Method 1 should show up as "ok" and with the default limit, e.g. | ||
| // total NA RA result #nodes limit time type #rc thread method | ||
| // 32728 0 32728 ok - 1024M 0.045 c1 1 0x000000011b019c10 compiler/print/CompileCommandMemLimit$TestMain::method1(()J) | ||
| oa.shouldMatch("\\d+ +\\d+ +\\d+ +ok +" + numberNodesRegex + " +" + implicitMemoryLimit + " +.* +" + method1regex); |
There was a problem hiding this comment.
A minor suggestion regarding the regex. I find "\s+" more readable than " +" to match multiple spaces.
|
Just one suggestion which you may pick or ignore. Otherwise looks good. |
Many thanks, @ashu-mehra ! I will actually ignore your suggestion, because I want the expression to only match spaces precisely, not whitespaces. But for any-whitespace, I usually do as you suggest. |
|
@vnkozlov SAP did a test series and did not find any issues in their CI |
|
Okay, I will run our testing too. |
|
Looks like |
|
I attached hs_err file to JDK-8331283 |
I fixed the error, a simple typo (forgot to properly name the class in the option). Retested locally on Mac m1, confirmed that the test passes with this commit, fails without it. I am not sure what went wrong, since I did these tests beforehand. Maybe I pushed the wrong version. That is slightly concerning, however, since the error should have come up at SAP too. I guess they don't test with all these stress options. |
|
|
I tend to leave debug output in, if its not too large, to speed up any follow-up fixes I need to do later. But then, I did not do it consistently anyway, so I removed the output. |
|
Many thanks, @vnkozlov ! /integrate |
|
Going to push as commit ad78b7f.
Your commit was automatically rebased without conflicts. |
See [1] for previous discussions.
We'd like to introduce a default memory limit for compilations in debug builds. That way, we can catch pathological compiler errors that have an unreasonably high per-compilation memory footprint early during testing.
The default limit affects all compilations, unless the method is subject to a memory limit set from command line. Meaning,
-XX:CompileCommand=MemLimit,...overrules the default.Examples:
This lowers the memlimit for j.l.String methods - all methods will have the default 1GB limit in a debug JVM. Only j.l.String will run with a 100M limit:
-XX:CompileCommand=MemLimit,java.lang.String::*,100mThis disables the default memlimit globally:
-XX:CompileCommand=MemLimit,*.*,0The patch:
I also fixed up some copyrights that I overlooked last year when adding the compiler memory statistics this patch builds atop of.
Tested:
[1] https://mail.openjdk.org/pipermail/hotspot-compiler-dev/2024-April/074787.html
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/18969/head:pull/18969$ git checkout pull/18969Update a local copy of the PR:
$ git checkout pull/18969$ git pull https://git.openjdk.org/jdk.git pull/18969/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 18969View PR using the GUI difftool:
$ git pr show -t 18969Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/18969.diff
Webrev
Link to Webrev Comment