Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8074307

Exception events broken in JFR

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Not an Issue
    • Icon: P3 P3
    • tbd
    • 8
    • hotspot
    • jfr

      While investigating the behaviour of JFR Exception and Error events I produced a small program:

      public class ExceptionProducer {

      private static Throwable THIS_THROWABLE;

      public static void main(String[] args) {
      while (true) {
      THIS_THROWABLE = new NullPointerException();
      THIS_THROWABLE = new InstantiationError();
      }
      }
      }

      Doing a small (3 s) recording I get 523072 Java Error events, all stacktraces going from java.lang.Error.<init>() up to ExceptionProducer.main(String[]).

      At the same time I get 1569219 Java Exception events:

      # events 1st frame 2nd frame 3rd frame
      523073 java.lang.Throwable.<init>() java.lang.Exception.<init>() java.lang.RuntimeException.<init>()
      523072 java.lang.Throwable.<init>() java.lang.Error.<init>() java.lang.LinkageError.<init>()
      523072 java.lang.Error.<init>() java.lang.LinkageError.<init>() java.lang.IncompatibleClassChangeError.<init>()

      While it is correct that Java Exception events should be created errors, it seems like every error creation alse creates two JFR events - one from the constructor of java.lang.Throwable and on from the constructor of java.lang.Error.
      Are we somehow doing an extra event creation because of the Java Error event creation?

            Unassigned Unassigned
            mjoelson Mattias Joƫlson (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: