-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8304436: com/sun/jdi/ThreadMemoryLeakTest.java fails with "OutOfMemoryError: Java heap space" with ZGC #13130
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
8304436: com/sun/jdi/ThreadMemoryLeakTest.java fails with "OutOfMemoryError: Java heap space" with ZGC #13130
Conversation
|
/issue add JDK-8304449 |
|
👋 Welcome back cjplummer! A progress list of the required criteria for merging this PR into |
|
@plummercj |
|
@plummercj The following label will be automatically applied to this pull request:
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. |
Webrevs
|
|
@plummercj 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 103 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. ➡️ To integrate this PR with the above commit message to the |
|
Can I get one more review please? Thanks! |
dcubed-ojdk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thumbs up. Thanks for the explanations in the PR and in the
bug reports.
What kind of testing has been done on this fix?
I ran this tests 25 times on each supported platform, both with and with ZGC. |
|
Was the com/sun/jdi/ThreadMemoryLeakTest.java test executed by itself in those |
|
Just the one test. |
|
Okay. Let's go with it and I'll keep an eye on the CI (like usual)... |
|
/integrate |
|
Going to push as commit 9643f65.
Your commit was automatically rebased without conflicts. |
|
@plummercj Pushed as commit 9643f65. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
There are two GC related issues with this test that are being addressed. The test was limiting the heap size to 6m so if there is still a leak, it will be detected quickly. This proved to be too small of a size when using ZGC. For the most part changing the size to 7m fixed this issue. However, I was still seeing frequent issues with ZGC on macOS. This is explained by JDK-8304449, which noticed (rarely) OOME on macos even when not using ZGC. From JDK-8304449:
"macOS has a thread behavior that is not seen on linux and windows that is causing more memory usage, which sometimes leads to this unexpected OOME. The debuggee side of the test constantly creates threads that do little more than a short sleep. It has a counter of "live" threads, and won't let that go over 500. On the debugger side it is just tracking ThreadStartEvents and ThreadDeathEvents. It keep tracks of threads (ThreadReferences) for which a ThreadStartEvent had been received but a ThreadDeathEvent has not. On linux and windows the count of outstanding threads is generally in the 200-400 range, sometimes briefly going over 500. However, on macOS it is closer to 2400. This means a lot more ThreadReferences being tracked, which means more memory usage, so sometimes you see an OOME on macOS as a result. "
The
threadscollection mainly existed just so its size could be used to log the number of outstanding ThreadDeathEvents. I got rid of thethreadscollection and instead am just tracking the number of ThreadStartEvents and ThreadDeathEvents, and computing the difference to get the number of outstanding ThreadDeathEvents.Progress
Issues
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/13130/head:pull/13130$ git checkout pull/13130Update a local copy of the PR:
$ git checkout pull/13130$ git pull https://git.openjdk.org/jdk.git pull/13130/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 13130View PR using the GUI difftool:
$ git pr show -t 13130Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/13130.diff