I start continous flight regarding for my app like this:
java -XX:StartFlightRecording:filename=jfr-logs/ ...
Everytime the app is stopped, a new file is generated in the jfr-logs directory:
ls -l jfr-logs
-rw-r--r-- 1 jumar staff 2.2M Dec 13 09:28 hotspot-pid-57471-id-1-2021_12_13_09_28_01.jfr
-rw-r--r-- 1 jumar staff 1.0M Dec 13 09:28 hotspot-pid-57923-id-1-2021_12_13_09_28_19.jfr
I'd like to make sure thare are no more than X number of these files and/or that they don't consume more than Y MBs of disk space.
I run this app in a Docker container and the jfr-logs directory is stored on a persistent volume.