profilingjmcjava-mission-controljfr

Are exceptions counted for JVM lifetime in Java Flight Recorder?


I have run a Java Flight Recorder recording for 2 minutes on a JBoss EAP 6.1 app server under load. I enabled exception counting (Java Application => Java Exception => Enabled=true) and I'm surprised by the number of reported exceptions.

When I look in the Events => Histogram view with event type "Java Application/ Java Exception" and Group by "Event Thread", 10 threads have over 2000 exceptions each. 3 of them have over 3000 exceptions.

This is the total number of reported creations of Throwable or Error:

Stack Trace                          Sample Count
java.lang.Throwable.<init>()              128 059
java.lang.Throwable.<init>(String)        116 107
java.lang.Throwable.<init>(Throwable)      39 207
java.lang.Error.<init>()                        7
java.lang.Throwable.<init>(String, Throwable)   2

So I'm wondering if all these exceptions occurred during the 2 minute period I recorded or are they counted since the start of the JVM?


Solution

  • "Sample Count" column in the Histogram tab aggregates the number of events with respect to a field value, in your case I believe the top frame of the stack trace. So the number 128 059 means there were that many events emitted with a top frame of "java.lang.Throwable.<init>()" during your recording.

    This may not be the information you are looking for.

    I recommend using the recording template to enable Exceptions / Errors, and looking at the Exceptions tab, instead of editing settings for individual events and using the Histogram tab.