Integrated: 8307374: Add a JFR event for tracking RSS

Stefan Karlsson stefank at openjdk.org
Wed Jun 7 11:44:14 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.

This pull request has now been integrated.

Changeset: 5722903d
Author:    Stefan Karlsson <stefank at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/5722903d53e90e36b284967aeb60d2f8b65a744c
Stats:     211 lines in 11 files changed: 211 ins; 0 del; 0 mod

8307374: Add a JFR event for tracking RSS

Reviewed-by: stuefe, rcastanedalo

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

PR: https://git.openjdk.org/jdk/pull/14285


More information about the hotspot-dev mailing list