-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8284642: Unexpected behavior of -XX:MaxDirectMemorySize=0 #8222
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 hseigel! A progress list of the required criteria for merging this PR into |
/label add hotspot_runtime |
@hseigel
|
Webrevs
|
/label add hotspot-runtime |
@hseigel |
How long exactly has this been broken? I'd be worried about use cases where people use MaxDirectMemorySize=0 to prevent usage of direct memory altogether. |
If nothing else, I think the man page could be improved to say that JVM chooses the size for NIO direct-buffer allocations automatically when MaxDirectMemorySize is not set. |
I looked around a bit but found no examples on GH or Google that relied on MaxDirectMemorySize=0 to disable direct memory. I found some examples of the opposite, e.g. cloudfoundry/java-buildpack#591. So I think this is fine. |
@hseigel 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 145 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 |
I don't think this is the right "fix". There is a bit of a disconnect between the VM option and the system property. Although the default value of the VM flag is zero, that is ignored and the JDK side, not being directed otherwise, determines the max size. If you set the flag explicitly to zero that is passed through to the JDK and the max memory is actually set to zero. I think this is more a documentation issue - MaxDirectMemory has no affect unless explicitly set on the command-line. The default value of the flag is actually irrelevant. |
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.
See main comment
Should no changes be made to the code, instead just remove "the size is set to 0, meaning that" from the description of MaxDirectMemorySize? -XX:MaxDirectMemorySize=size |
I would delete the last sentence:
and replace with:
|
Please review the updated man page change. |
I didn't realize that text was from the manpage. It is fine but I think we also need something in globals.hpp:
|
Hi David, Thanks for looking at this and for the suggested text. Please review this latest commit to fix the text in globals.hpp. |
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.
That all looks good to me.
Thanks,
David
Thanks for the reviews! /integrate |
Going to push as commit 975a060.
Your commit was automatically rebased without conflicts. |
Please review this small fix for JDK-8284642. The fix was tested by running Mach5 tiers 1-2 on Linux, Mac OS, and Windows, and Mach5 tiers 3-5 on Linux x64. Additionally, the modified test and the test in the bug report were run locally.
Thanks, Harold
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/8222/head:pull/8222
$ git checkout pull/8222
Update a local copy of the PR:
$ git checkout pull/8222
$ git pull https://git.openjdk.java.net/jdk pull/8222/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 8222
View PR using the GUI difftool:
$ git pr show -t 8222
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/8222.diff