RFR: 8307374: Add a JFR event for tracking RSS [v2]

Roberto Castañeda Lozano rcastanedalo at openjdk.org
Wed Jun 7 08:51:55 UTC 2023


On Mon, 5 Jun 2023 08:14:12 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.
>
> Stefan Karlsson has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Remove unused test imports

Marked as reviewed by rcastanedalo (Reviewer).

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

PR Review: https://git.openjdk.org/jdk/pull/14285#pullrequestreview-1467036406


More information about the hotspot-dev mailing list