-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add documentation for native memory tracking (NMT) #9788
base: master
Are you sure you want to change the base?
Conversation
Hi @olyagpl ! Can you please have a look at this when you have time? Thanks! |
toc_group: debugging-and-diagnostics | ||
link_title: Native Memory Tracking | ||
permalink: /reference-manual/native-image/debugging-and-diagnostics/NMT/ | ||
redirect_from: /reference-manual/native-image/NMT/ |
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.
Redirect is not needed, that's a new page. Please remove redirect_from: /reference-manual/native-image/NMT/
|
||
# Native Memory Tracking (NMT) with Native Image | ||
|
||
Native Memory Tracking (NMT) is a serviceability feature that records off-heap memory usage of your application. The terminology “off-heap memory” is sometimes used interchangeably with “native memory” or “unmanaged memory.” This essentially means any memory that is not managed by the garbage collector. |
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.
Please start each sentence in a paragraph from a new line (we are still trying to polish this everywhere).
## JFR Events for NMT | ||
The OpenJDK JFR events `jdk.NativeMemoryUsage` and `jdk.NativeMemoryUsageTotal` are supported in Native Image. | ||
|
||
There are also two Native Image specific JFR events that you can access: `jdk.NativeMemoryUsagePeak` and `jdk.NativeMemoryUsageTotalPeak`. These Native Image specific events have been created to expose peak usage data otherwise not exposed through the JFR events ported over from the OpenJDK. It should be noted that these new are marked as experimental. You may need to enable experimental events in software like JDK Mission control in order to view them. |
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.
There are also two Native Image specific JFR events that you can access: jdk.NativeMemoryUsagePeak
and jdk.NativeMemoryUsageTotalPeak
. These Native Image specific events have been created to expose peak usage data otherwise not exposed through the JFR events ported over from the OpenJDK. These new are marked as experimental. You may need to enable experimental events in software like JDK Mission control in order to view them.
|
||
There are also two Native Image specific JFR events that you can access: `jdk.NativeMemoryUsagePeak` and `jdk.NativeMemoryUsageTotalPeak`. These Native Image specific events have been created to expose peak usage data otherwise not exposed through the JFR events ported over from the OpenJDK. It should be noted that these new are marked as experimental. You may need to enable experimental events in software like JDK Mission control in order to view them. | ||
|
||
Below is example of what the new events look like viewed using the `jfr` command line tool: |
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 below the example of what the new events look like when viewed using the jfr
command line tool:
eventThread = "JFR Shutdown Hook" (javaThreadId = 63) | ||
} | ||
``` | ||
To use these JFR events for NMT, JFR must be included as a feature at build time and started at runtime. |
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.
To use these JFR events for NMT, JFR must be included as a feature at build time and started at runtime. (Learn more in JDK Flight Recorder (JFR) with Native Image).
@roberttoyonaga, I left some suggestions. Thank you for your contribution! In the description, you mention it should be added/backported to the GraalVM for JDK 23 docs, is that correct? |
Co-authored-by: Olga Gupalo <olga.gupalo@oracle.com>
Co-authored-by: Olga Gupalo <olga.gupalo@oracle.com>
Co-authored-by: Olga Gupalo <olga.gupalo@oracle.com>
Co-authored-by: Olga Gupalo <olga.gupalo@oracle.com>
Co-authored-by: Olga Gupalo <olga.gupalo@oracle.com>
Co-authored-by: Olga Gupalo <olga.gupalo@oracle.com>
Co-authored-by: Olga Gupalo <olga.gupalo@oracle.com>
Thank you for the review @olyagpl ! I've applied your suggestions and updated the doc |
Yes, that's right. NMT is also supported in GraalVM for JDK 23 so these docs should be backported to that version too. No content needs to be changed for the backport though. |
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.
Some minor leftovers I missed. Other than that, I'm going to "post-process" this pull request from my end (open an internal PR, add a new page to the website navigation) and get back to you.
Co-authored-by: Olga Gupalo <olga.gupalo@oracle.com>
Co-authored-by: Olga Gupalo <olga.gupalo@oracle.com>
Co-authored-by: Olga Gupalo <olga.gupalo@oracle.com>
Summary
Adding some documentation for NMT. This should be added to GraalVM for JDK 23. Thanks!