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
JDK-8260282: Add option to compress heap dumps created by -XX:+HeapDumpOnOutOfMemoryError #2222
Conversation
|
@schmelter-sap 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
|
"When HeapDumpOnOutOfMemoryError is on, the gzip compression " \ | ||
"level of the dump file. 0 (the default) disables gzip " \ | ||
"compression. Otherwise the level must be between 1 and 10.") \ | ||
range(0, 10) \ |
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.
Isn't the range 0-9? Although HeapDumper::dump()
imposes no upper limit (it seems it should), the HeapDumpDCMD
sets the upper limit to 9. See HeapDumpDCmd::execute()
.
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.
You're right. 9 is the maximum compression level supported by zlib. I will update the PR.
You need to run the test with a limited sized heap. Otherwise it may impact other tests, and would need to be moved into the resourcehogs directory.
I've added a -Xmx128M. This should probably also done to TestHeapDumpOnOutOfMemoryError, which uses the same code. |
Yes, it should. Probably it hasn't caused failures because my recollection is that it usually takes 2 or more such heap exhaustion tests running in parallel to result in unexpected failures in our testing, but it really depends on the test host and available memory. Also, the metaspace version of the test does use |
@schmelter-sap This change now passes all automated pre-integration checks. 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 44 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.
|
Looks like this was just addressed today by JDK-8252545. |
Looks good. Nitpickings below, but I leave it up to you which ones you follow up to. Otherwise fine.
..Thomas
* @test | ||
* @summary Test verifies that -XX:HeapDumpGzipLevel=0 works | ||
* @library /test/lib | ||
* @run driver/timeout=240 TestGZippedHeapDumpOnOutOfMemoryError run 0 |
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.
Is the timeout needed? Should the oome not be pretty much instantaneous?
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.
The timeout is not for the VM which creates the OOM, but the VM which starts that VM and then parses the created hprof file. I took the timeout from the TestHeapDumpOnOutOfMemoryError test, ,which seemed to run fine with this value.
* @summary Test verifies that -XX:HeapDumpGzipLevel=1 works | ||
* @library /test/lib | ||
* @run driver/timeout=240 TestGZippedHeapDumpOnOutOfMemoryError run 1 | ||
*/ |
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.
If the tests are fast enough, I would add at least another one at the end of the valid gzip range.
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.
I don't think that this is needed, since these test should not test the gzipping (there are already tests for that).
String heapdumpFilename = "java_pid" + proc.pid() + ".hprof" + (level > 0 ? ".gz" : ""); | ||
OutputAnalyzer output = new OutputAnalyzer(proc); | ||
output.stdoutShouldNotBeEmpty(); | ||
output.shouldContain("Dumping heap to " + heapdumpFilename); |
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.
Could this be a full path? In case printing on the VM side is ever changed to print the full path, I'd make this more lenient. Maybe two separate contains expressions or a shouldMatch
with ".*" int he middle.
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.
I think that if the VM output changes, it is OK to adjust the test. Making it more lenient could also make it less accurate.
/integrate |
@schmelter-sap Since your change was applied there have been 68 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit d2b0ea1. |
This change adds the optiont to created a gzipped heap dump by -XX:+HeapDumpOnOutOfMemoryError.
-XX:HeapDumpGzipLevel= sets the compression level. 0 (the default) means no gzipping of the dump. Otherwise the level has to be between 1 and 10.
Progress
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/2222/head:pull/2222
$ git checkout pull/2222