Skip to content
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

[GR-52942] Add JFR events and track peak usage for native memory tracking. #8462

Merged
merged 1 commit into from
Apr 4, 2024

Conversation

roberttoyonaga
Copy link
Collaborator

@roberttoyonaga roberttoyonaga commented Feb 27, 2024

This pull request adds JFR events for recently added native memory tracking.

It also adds tracking of peak malloc usage. Unfortunately, the stock NMT JFR events from the openJDK do not contain peak usage data. So the only way to view the peak usage data is by specifying -XX:+PrintNMTStatistics at runtime. Another possibility is to add Native Image specific NativeMemoryUsagePeak events.

See issue: #8452

@roberttoyonaga roberttoyonaga self-assigned this Feb 27, 2024
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Feb 27, 2024
@roberttoyonaga roberttoyonaga force-pushed the add-jfr-nmt-events branch 7 times, most recently from 2bc5cdf to e76be3c Compare March 1, 2024 17:28
@roberttoyonaga
Copy link
Collaborator Author

I've added 2 native image specific events to expose peak tracking information: svm.NativeMemoryUsageTotalPeak and svm.NativeMemoryUsagePeak. I think it's very useful to have access to the peak usage data through JFR. In OpenJDK the peak usage data can be accessed through jcmd, but this isn't available in native image.

@christianhaeubl christianhaeubl changed the title Add JFR events and track peak usage for native memory tracking (NMT) [GR-52942] Add JFR events and track peak usage for native memory tracking. Mar 27, 2024
Copy link
Member

@christianhaeubl christianhaeubl left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, most parts look good. Before I integrate this PR, please squash all your commits (it seems that most commits are just fixup commits and don't have a dedicated purpose).

Please note that I plan to do a few cleanups and fixes on top before integration.

@roberttoyonaga
Copy link
Collaborator Author

Thanks @christianhaeubl ! I've updated the PR with the commits squashed.

Copy link
Member

@christianhaeubl christianhaeubl left a comment

Choose a reason for hiding this comment

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

Thanks!

@christianhaeubl
Copy link
Member

We had some internal discussions regarding the Native Image-specific events. I marked the events as @Experimental (because NMT is experimental), changed the name-prefix to jdk. instead of svm., and changed the category to {"Java Virtual Machine", "Memory"}.

Please have a look at my PR and let me know if you think that any of those changes are an issue: #8668.

@graalvmbot graalvmbot merged commit 06c6404 into oracle:master Apr 4, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
native-image native-image-jfr OCA Verified All contributors have signed the Oracle Contributor Agreement. redhat-interest
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants