Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java Mission Control code profiler empty

Tags:

java

jmc

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.sstatic.net/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.

like image 312
olafure Avatar asked Feb 04 '26 21:02

olafure


1 Answers

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.

like image 79
Klara Avatar answered Feb 06 '26 10:02

Klara