Skip to content

JDK-8299672: Enhance HeapDump JFR event #11864

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

Closed
wants to merge 5 commits into from

Conversation

MBaesken
Copy link
Member

@MBaesken MBaesken commented Jan 5, 2023

Enhance the JFR Event HeapDump with the additional interesting fields, compression and overwrite.
Add some UL logging in case the heap dump writing failed .


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/11864/head:pull/11864
$ git checkout pull/11864

Update a local copy of the PR:
$ git checkout pull/11864
$ git pull https://git.openjdk.org/jdk pull/11864/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 11864

View PR using the GUI difftool:
$ git pr show -t 11864

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/11864.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 5, 2023

👋 Welcome back mbaesken! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 5, 2023
@openjdk
Copy link

openjdk bot commented Jan 5, 2023

@MBaesken The following label will be automatically applied to this pull request:

  • hotspot

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.

@openjdk openjdk bot added the hotspot hotspot-dev@openjdk.org label Jan 5, 2023
@mlbridge
Copy link

mlbridge bot commented Jan 5, 2023

Webrevs

Copy link
Contributor

@schmelter-sap schmelter-sap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@@ -65,6 +65,8 @@ public static void main(String[] args) throws Exception {
Events.assertField(e, "gcBeforeDump").equal(true);
Events.assertField(e, "onOutOfMemoryError").equal(false);
Events.assertField(e, "size").equal(Files.size(path));
Events.assertField(e, "compression").equal(-1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would use below(1) instead of equals(-1), since it is not specified which value < 1 is used when gzip compression is not enabled. Or you could do the sanitizing when storing the value in the event itself. But in that case I would probably use 0 instead of -1.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Ralf, thanks for the review.
I adjusted the test as suggested.

@openjdk
Copy link

openjdk bot commented Jan 9, 2023

@MBaesken 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:

8299672: Enhance HeapDump JFR event

Reviewed-by: rschmelter, clanger

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 81 new commits pushed to the master branch:

  • 5a9490a: 8299853: Serial: Use more concrete type for TenuredGeneration::_the_space
  • f857f8a: 8299327: Allow super late barrier expansion of store barriers in C2
  • 257f667: 8296789: -completion in jshell fails to expose synthetic bridge methods
  • 030e88d: 8299829: In jshell, the output of "0".repeat(49999)+"2" ends with a '0'
  • ef32fdb: 8284825: sun/java2d/DirectX/MultiPaintEventTest/MultiPaintEventTest.java failed with "RuntimeException: Processed unnecessary paint()."
  • 95b102c: 8299309: Test "java/awt/Dialog/ModalDialogTest/ModalDialogTest.java" fails because new frame was not displayed when "New Frame" button was clicked
  • f312c99: 8299482: Remove metaprogramming/isIntegral.hpp
  • 10a747c: 8299479: Remove metaprogramming/decay.hpp
  • ddca2b9: 8299701: Remove unused GCCause::_wb_conc_mark
  • c595f96: 8299278: tools/jpackage/share/AddLauncherTest.java#id1 failed AddLauncherTest.bug8230933
  • ... and 71 more: https://git.openjdk.org/jdk/compare/872384707e89d03ede655aad16f360dc94f10152...master

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 master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jan 9, 2023
@egahlin
Copy link
Member

egahlin commented Jan 9, 2023

What's the rationale for adding compression level and overwrite?

@MBaesken
Copy link
Member Author

The support for gzipped heap dumps was added recently with "8237354: Add option to jcmd to write a gzipped heap dump" but not reflected in JFR so I wanted to add it here too to get a full picture of the heap dump creation.
The overwrite field was just added for completion, no specific reason.

Copy link
Contributor

@RealCLanger RealCLanger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some spelling issues, for consistency.

@@ -1144,11 +1144,14 @@
<Field type="ulong" contentType="bytes" name="size" label="Size Written" />
</Event>

<Event name="HeapDump" category="Java Virtual Machine, Diagnostics" label="Heap Dump" stackTrace="true" thread="true">
<Field type="string" name="destination" label="Destination" />
<Event name="HeapDump" category="Java Virtual Machine, Diagnostics" label="Heap Dump" description="Information about a successfully written Java Heap dump"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spelling: "Java heap dump" in description (small heap)

<Field type="string" name="destination" label="Destination" />
<Event name="HeapDump" category="Java Virtual Machine, Diagnostics" label="Heap Dump" description="Information about a successfully written Java Heap dump"
stackTrace="true" thread="true">
<Field type="string" name="destination" label="Destination path of the dump" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling: In the label we'd write Path and Dump in capitals

<Field type="long" name="size" label="Size" />
<Field type="boolean" name="gcBeforeDump" label="GC Before Dump" />
<Field type="boolean" name="onOutOfMemoryError" label="On Out of Memory Error" />
<Field type="boolean" name="onOutOfMemoryError" label="Heap dump on Out of Memory Error" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also here: "Dump" in capitals in the label

<Field type="boolean" name="onOutOfMemoryError" label="On Out of Memory Error" />
<Field type="boolean" name="onOutOfMemoryError" label="Heap dump on Out of Memory Error" />
<Field type="boolean" name="overwrite" label="Overwrite" description="Heap dump overwrites previous file location if it exists" />
<Field type="int" name="compression" label="Compression Level" description="Compression level of the Dump, if larger than 0 we use gzip compressoion with this level" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, in description, use small letter for "dump"

@MBaesken
Copy link
Member Author

Hi Christoph, I did some adjustments (also compressoion -> compression).

Copy link
Contributor

@RealCLanger RealCLanger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me now.

PS: The metadata.xml also has a copyright year to update which you should do before integrating.

@egahlin
Copy link
Member

egahlin commented Jan 11, 2023

The support for gzipped heap dumps was added recently with "8237354: Add option to jcmd to write a gzipped heap dump" but not reflected in JFR so I wanted to add it here too to get a full picture of the heap dump creation.
The overwrite field was just added for completion, no specific reason.

Not sure what the user is going to do with the information, but OK.

@MBaesken
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented Jan 12, 2023

Going to push as commit 0ee8cac.
Since your change was applied there have been 102 commits pushed to the master branch:

  • d716ec5: 8299179: ArrayFill with store on backedge needs to reduce length by 1
  • af8d3fb: 8264684: os::get_summary_cpu_info padded with spaces
  • 78b1686: 8227257: javax/swing/JFileChooser/4847375/bug4847375.java fails with AssertionError
  • 33f3bd8: Merge
  • 945ef07: 8299862: OfAddress setter should disallow heap segments
  • 636976a: 8299849: Revert JDK-8294461: wrong effectively final determination by javac
  • 0abb87a: 8299227: host exif.org not found in link in doc comment
  • de79162: 8299715: IR test: VectorGatherScatterTest.java fails with SVE randomly
  • 151450e: 8294744: AArch64: applications/kitchensink/Kitchensink.java crashed: assert(oopDesc::is_oop(obj)) failed: not an oop
  • 21d468e: 8299733: AArch64: "unexpected literal addressing mode" assertion failure with -XX:+PrintC1Statistics
  • ... and 92 more: https://git.openjdk.org/jdk/compare/872384707e89d03ede655aad16f360dc94f10152...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jan 12, 2023
@openjdk openjdk bot closed this Jan 12, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jan 12, 2023
@openjdk
Copy link

openjdk bot commented Jan 12, 2023

@MBaesken Pushed as commit 0ee8cac.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot hotspot-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

4 participants