-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8270321: Startup regressions in 18-b5 caused by JDK-8266310 #4893
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
👋 Welcome back sercher! A progress list of the required criteria for merging this PR into |
|
I don't understand your analysis, you are testing the startup time with -Xint which disable JITs, but there is no mention of -Xint in the bug report. I think you should first try to reproduce the issue with the correct flags and then follow the advice from Mandy on how to implement the fix. Using an anonymous class may introduce more allocation than using a lambda once the code is JITed. |
|
Hi Rémi,
I apologize, perhaps I wasn't quite clear describing the analysis. Also, there was a faulty picture, -Xint was only used to grab the opcode traces to build the flamegraphs. I replaced the faulty image and posted additional graphs with -XX:+UseZGC.
In my opinion removing computeXXX methods defeats the purpose of the entire deadlock fix. It is sufficient to avoid using lambdas in order not to trigger the method handles initialization, which is what Mandy Chung is really suggesting in the first note in JBS.
I provided live objects dumps after noop.jar has been loaded with JIT enabled. Please see the attached histograms. The difference is always the same after full GC (1000 bytes in 12 objects compared to pre JDK-8266310 version tested w/G1) and it doesn't change with subsequent executions. The patch resolves the memory regression as you may observe in RSS graphs and heap dumps. Please see 'fixed.histogram' in comparison with the object dump before the fix (post JDK-8266310) in 'original.histogram'. |
Eric Caspole (the submitter) may be able to share more data but the startup regression looks plausible given that this code executes early in the startup. |
|
NativeLibraries was called early during VM startup and the startup benchmark is just a Noop. So the lambda creation by NativeLibraries is likely still running in interpreted mode. Looks like replacing it with an anonymous class may be an alternative. I ran a few startup benchmarks on linux x64 with this patch. It does show that the startup regression is fixed and also the footprint benchmark I included does not show any regression. |
|
Hi Sergey, Using anonymous classes instead of lambdas is good for me. |
|
@sercher 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 72 new commits pushed to the
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. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@mlchung, @AlanBateman) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
|
Thanks Sergey for dealing with this while I was on vacation, and sorry for causing this regression! Looks good (not a reviewer). |
|
/integrate |
|
/sponsor |
|
Going to push as commit 5b3c418.
Your commit was automatically rebased without conflicts. |
|
@AlexanderScherbatiy @sercher Pushed as commit 5b3c418. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Dear colleagues,
Please review the patch that replaces the lambdas with anonymous classes which solves the startup time regression as shown below.
I attached the Bytestacks flamegraphs for both original (regression) and fixed versions. The flamegraphs clearly show the lambdas were causing the performance issue.
bytestacks_flamegraphs.zip
Although the proposed JDK-8270321 patch fixes the startup time (it might appear even better than it was before the regression was introduced, i.e. before JDK-8266310) and generally fixes the footprint regression, it may increase MaxRSS slightly compared to the version before JDK-8266310, which is shown in the below graphs. (updated)
(update: added ZGC graphs)
I additionally include the heap objects histograms to show the change does not increase the total live objects size significantly with only 1000 bytes the total difference, namely 1116128 bytes in 25002 live objects after the proposed fix JDK-8270321 compared to 1115128 bytes in 24990 objects in the version with the original patch reverted (i.e. before JDK-8266310).
histograms.zip
The patch was tested w/hotspot/tier1/tier2 test groups.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4893/head:pull/4893$ git checkout pull/4893Update a local copy of the PR:
$ git checkout pull/4893$ git pull https://git.openjdk.java.net/jdk pull/4893/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 4893View PR using the GUI difftool:
$ git pr show -t 4893Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4893.diff