Forum Stats

  • 3,770,915 Users
  • 2,253,181 Discussions
  • 7,875,654 Comments

Discussions

Difference between "Method Profiling" and "Java Application" Stack Trace?

Per Mildner
Per Mildner Member Posts: 12
edited Nov 6, 2017 7:47AM in Java Mission Control

Migrating from JMC 5 I am looking for what used to be called the "Hot Methods", i.e. stack traces for the hot methods.

JMC 6 has "Method Profiling" whose stack frames have much fewer sample counts than the stack traces for "Java Application". What do these two things mean and which one of these, if any, should I use to see the hot methods?

(If it matters: I am always using -XX:+DebugNonSafepoints and I always want to look at all threads for the entire lifetime of the process. My processes runs for hours.)

(I have not found any sufficiently detailed documentation for JMC 6.)

«1

Answers

  • Klara Ward, Java Mission Control Dev-Oracle
    edited Nov 1, 2017 9:10AM

    The default stack frames on the Java Application page are from multiple event types, profiling, allocation, latency etc.

    If you select the Profiling lane in the chart,  you should see same subset as on the Method Profiling page.

    Per Mildner
  • Per Mildner
    Per Mildner Member Posts: 12
    edited Nov 1, 2017 9:24AM

    How do I "select the Profiling lane in the chart"? I tried this: I unchecked the "Halts", "Machine Total" et al. check boxes (all except "Profiling") when I had "Java Application" selected in the Outline. This did not affect the Stack Trace window (it still shows many more samples than when I select "Method Profiling" in the Outline).

    So, is selecting "Method Profiling" in the Outline the same as the Hot Methods in JMC 5?

  • Klara Ward, Java Mission Control Dev-Oracle
    edited Nov 1, 2017 10:24AM

    You have to check the "Profiling" text in the chart.

    IIRC, selecting a checkbox label (rather then checking/unchecking the checkboxes) should also affect what is displayed in Properties and Stack Trace views, but it seems to me this is not working properly.

    The information in Method Profiling is the same as in Hot Methods in JMC 5.

    Per Mildner
  • Klara Ward, Java Mission Control Dev-Oracle
    edited Nov 1, 2017 10:33AM

    As an internal reference, I opened https://bugs.openjdk.java.net/browse/JMC-5713  to investigate if the current behavior is correct or not.

  • Per Mildner
    Per Mildner Member Posts: 12
    edited Nov 1, 2017 11:38AM

    When I open the same Java 8 JFR file in JMC 5 (from JDK 1.8.0_144) and in JMC JMC 6 (from JDK 9.0.1) I do not see the same number of samples. Should they be the the same?

    When I select Code/Overview/Hot Classes, the top entry is java.util.TimSort with 171031 samples in JMC 5, but if I select Java Application/Method Profiling/Top Class in JMC 6 it says the Count is 145120.

    When I select Code/Hot Methods in JMC 5 the fifth entry (the first of my own methods) has 19096 samples but this method is not even present in the JMC 6 Java Application/Method Profiling/Stack Trace table. Also, the common entries, like TimSort.binarySort() has a higher Sample Count in JMC 5 than the Count in JMC 6.

    What am I missing?

    (This is on macOS 10.12. The JFR file was generated on some other machine, using some version of OpenJDK 1.8.)

  • Klara Ward, Java Mission Control Dev-Oracle
    edited Nov 1, 2017 12:02PM

    JMC 5 and 6 should show the same values.

    Doublecheck that you the top left dropdown on the Method Profiling page says <No Selection>

    Is the Top Package info the same in JMC 5 and 6?

  • Per Mildner
    Per Mildner Member Posts: 12
    edited Nov 2, 2017 4:42AM

    Yes, the top package is java.util in both, with a little lower count in JMC 6. (I can not select anything in the top left dropdown menu (to the left of "Aspect:"), it only has a single item "<No selection>".)

    I have uploaded a non-sensitive screenshot showing top-package information in both versions. https://pasteboard.co/GRKSCBX.png

    PS. Has the percentage column been removed in JMC 6? I find percentage more useful than raw sample count, in most cases.

  • Klara Ward, Java Mission Control Dev-Oracle
    edited Nov 3, 2017 4:42AM

    Can you check the total number of Method Profiling Sample in the recording, in both JMC 5.x and 6 and see if they are the same?

    In 5.x, go to Events/Overview, enable the Method Profiling Sample event in the Event Types view to the left, then check the Event Types table to see how many

    In 6, go to the Event Browser and check.

    Yes, we removed the Percentage column, and only kept the colored backdrop. I will open an issue about at least one real world user wanting the Percentage column back....

    If you would be able to create a recording with less sensitive data, I would be happy to have a look.

  • Klara Ward, Java Mission Control Dev-Oracle
    edited Nov 3, 2017 6:42AM

    For internal reference, I opened https://bugs.openjdk.java.net/browse/JMC-5721 to cover the percentage column.

  • Per Mildner
    Per Mildner Member Posts: 12
    edited Nov 6, 2017 6:02AM

    The Method Profiling Sample is the same, 704961, in both versions.

    I will try to get some data that I can share.

This discussion has been closed.