RFR: 8307374: Add a JFR event for tracking RSS

Roberto Castañeda Lozano rcastanedalo at openjdk.org
Fri Jun 2 15:08:05 UTC 2023


On Fri, 2 Jun 2023 13:41:18 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:

> Add A JFR event to track the resident set size (RSS) of the running process. This is a good complement to the new Native Memory Tracking events that were added for JDK 20 ([JDK-8157023](https://bugs.openjdk.org/browse/JDK-8157023))
> 
> You can use the JDK Mission Control tool to extract this data. Or, you can use the new [JFR Views](https://egahlin.github.io/2023/05/30/views.html) tool to get a textual representation of the values:
> 
> 
> # Create a JFR recording
> $ jdk/bin/java -XX:StartFlightRecording=dumponexit=true JavaApp
> 
> # Extract the data from that recording
> $ jdk/bin/jfr view ResidentSetSize hotspot-pid-204767-id-1-2023_06_02_11_56_19.jfr 
> 
>                                Resident Set Size
> 
> Time                     Resident Set Size         Resident Set Size Peak Value
> ---------------- ------------------------- ------------------------------------
> 11:56:07                            1.1 GB                               1.2 GB
> 11:56:08                          333.7 MB                               1.2 GB
> 11:56:09                          432.4 MB                               1.2 GB
> 11:56:10                          695.9 MB                               1.2 GB
> 11:56:11                            1.0 GB                               1.2 GB
> 11:56:12                            1.3 GB                               1.3 GB
> 11:56:13                            1.3 GB                               1.3 GB
> 11:56:14                            1.3 GB                               1.3 GB
> 11:56:15                            1.3 GB                               1.3 GB
> 11:56:16                            1.3 GB                               1.3 GB
> 11:56:17                            1.4 GB                               1.4 GB
> 11:56:18                            1.8 GB                               1.8 GB
> 11:56:19                            2.0 GB                               2.0 GB
> 
> 
> The event has been implemented for Linux, MacOS, and Windows. The name ResidentSetSize isn't a perfect fit for the values extracted from MacOS and Windows, but I think it is better to name this after something that many people are familiar with instead of trying to find a generic name that fits all platforms. Do you agree with that, or should we change it to something else?
> 
> I've manually sanity checked that we get reasonable values on all OS:es. I've also added a jtreg test.

Thanks for proposing this enhancement, Stefan! I tried it out (on Linux) and it worked just fine.

> The event has been implemented for Linux, MacOS, and Windows. The name ResidentSetSize isn't a perfect fit for the values extracted from MacOS and Windows, but I think it is better to name this after something that many people are familiar with instead of trying to find a generic name that fits all platforms. Do you agree with that, or should we change it to something else?

I agree with naming it ResidentSetSize, even some popular operating system textbooks such as "the dinosaur book" use this term as a general concept.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/14285#issuecomment-1573885783


More information about the hotspot-dev mailing list