I have a very resource intensive, java-8 based, command line application that I frequently profile with flight recorder. What I often notice is that when I open the flight recorder file (the jfr) in mission control I see the full timespan the process has run for, but I'm missing events for the first 60-70% of this time window.
I've tried playing with the flight recorder options, here's what I'm currently using:
-Djava.library.path=/some/path/lib -Xmx50G -XX:+UnlockCommercialFeatures -XX:+UseG1GC -XX:+FlightRecorder -XX:StartFlightRecording=name=MyRecording,settings=profile -XX:FlightRecorderOptions=defaultrecording=true,maxsize=1g,maxage=1h,dumponexit=true,dumponexitpath=/some/path"
My hope was that this would automatically capture a recording, that the recording would save to /some/path when the process completes, and that the file it saves would be up to a gigabyte. Does anyone know what the correct options to supply would be?
I'll answer my own question. After some experimentation and trial and error it seems you need to add 'disk=true'.
So the final java args become: