Reputation: 1103
For the duration of a recording using Java Flight Recorder, will all the methods that are called within that duration be listed in a RecordedFile?
Given that:
Thanks in advance for any answers.
Upvotes: 1
Views: 588
Reputation: 98332
No.
First, JFR is a sampling profiler. It does not record all method transitions; it takes periodic samples instead. I.e. once in the specified time interval, it looks at the call stacks of the threads running at the moment.
Second, JFR tends to miss many samples when it fails to traverse a valid Java stack. I demonstrated this effect in my presentation: JFR caught just one meaningless application stack trace out of 10 seconds of execution.
You can choose how many samples JFR collects by tuning the sampling period
setting. The smaller is period - the more stack samples JFR collects. However, the smallest possible period is just 1 ms. Furthermore, the sampling frequency does not scale well with the number of running threads. There is just one thread that collects all ExecutionSample
events, no matter how many cores your server has.
Upvotes: 4