Flight recorder is most commonly used to dump the last few minutes of data. Either by doing a profiling recording for a minute or so, or by having a continuous recording which is later dumped when some anomaly was discovered using a monitoring tool, for example the JMC JMX console.
Sometimes though, people bring me enormous recordings. Now, enormous recordings are not handled well in JMC. Most of the time, JMC will discover that you are trying to open something that is too large, and prompt you for what subset of the recording you want to open.
Sometimes it is easier to simply split the recording into smaller recordings instead.
Here is a small tool that can be used for splitting flight recordings:
java -jar split.jar filename [targetSizePerFile in MiB (default 50)]
Note that the jfr file will be split along chunk boundaries using a best effort algorithm. The individual files will be as close to the specified target size as the chunk boundaries allow.
Let me know if you run into trouble! 🙂
[…] the Splitting Flight Recorder Files blog entry for more information on how to use the […]
We actually use JFR for long-term performance analysis, let’s say record the events on the server while our 2-hour load run test is being executed. That gives us a whole lot of awesome metrics on our EJB, database, servlet, transactions, etc. It is quite impressive. And yes I need to open these 200MB JFR files in a machine with around 24 GB of RAM but it is ok because it gives us so much info to work with!
Great to hear about your success! 🙂
we have similar issue running our application on Linux.
Go to the repository directory at the end of the day and you will see tens of files with a total size of about 1.5 Gig. They accumulate 1.5Gig per day.
We expecting that only one file will be kept with the most recent jfr data and all of the others will be deleted.
Why they keep growing and how to avoid this ?
You should always limit the set of data retained by flight recorder. Either use maxsize or maxage to limit how much data is retained in the repo.