3

I'm having a problem using Java Mission Control when the application being profiled sets the XX:MaxJavaStackTraceDepth system property to -1.

To reproduce:

  1. Fire up a java applciation: java -XX:+UnlockCommercialFeatures -XX:+FlightRecorder -XX:MaxJavaStackTraceDepth=-1
  2. Make Flight Recording for that app using default settings
  3. View the "Code" section in the generated record. It'll be empty, like this: https://i.stack.imgur.com/MLeQE.jpg

System: Ubuntu 14.04/amd64. Java 1.8.0_72.

Any suggestions to why this happens? I'd like to keep my stacktraces unlimited (due to some rare stack overflow exceptions which are very hard to find unless you have the beginning of the stack trace).

The -1 value comes from here: http://stas-blogspot.blogspot.se/2011/07/most-complete-list-of-xx-options-for.html#MaxJavaStackTraceDepth

Edit: The original question wrongly put the blame on java.endorsed.dirs system property. I had a bunch of property set and must have gotten confused in the process of elimination.

5
  • Hmm, weird. Is it only the Method profiling data (what's shown in the Code tab) that is missing? Did you try to repro with a really simple application, and not just Karaf? If we find the time, we in the JMC team can try to repro this.
    – Klara
    Jan 22, 2016 at 8:46
  • @Klara Thanks for the quick reply. Apologies, it's triggered by XX:MaxJavaStackTraceDepth=-1. I've updated the question and added a note about it at the end. It makes it much easier to workaround, but could be a bug in JMC? I had reported a bug JI-9028841, you might want to update that if you can :)
    – olafure
    Jan 22, 2016 at 10:49
  • Can you try using -XX:FlightRecorderOptions=stackdepth=<depth> instead? See hirt.se/blog/?p=364 and docs.oracle.com/javase/8/docs/technotes/tools/windows/java.html
    – Klara
    Jan 25, 2016 at 7:26
  • 1
    I've been able to reproduce the problem with -XX:MaxJavaStackTraceDepth=-1, and found at least one related bug - bugs.openjdk.java.net/browse/JDK-7179701, which is a low priority bug currently targeted for JDK 10.... My advice would be to use -XX:FlightRecorderOptions=stackdepth=2048 instead.
    – Klara
    Jan 27, 2016 at 10:17
  • Thanks @Klara. If you submit this as an answer then I can mark it accepted and you'll at least some some karma points for the fuzz!
    – olafure
    Jan 27, 2016 at 14:30

1 Answer 1

3

I've been able to reproduce the problem with -XX:MaxJavaStackTraceDepth=-1, and found at least one related bug - https://bugs.openjdk.java.net/browse/JDK-7179701, which is a low priority bug currently targeted for JDK 10.... My advice would be to use -XX:FlightRecorderOptions=stackdepth=2048 instead. I can't say I've done much experimenting with this option either, but at least it's designed to work with JFR.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.