Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make VisualVM show line numbers

Tags:

visualvm

I'm using VisualVM to profile a Scala program that has been compiled with the default of -g:vars, which includes line numbers (verified with javap that the class files have line numbers). However, VisualVM isn't showing any line numbers in any of its profiling, only method names. Is there any way to make it show files and line numbers? Using VisualVM 1.3.2 (and if it matters: Sun JDK 6 and Scala 2.9.0.1).

like image 439
Yang Avatar asked Jul 12 '11 06:07

Yang


1 Answers

Since this question comes up high in Google and several years have passed without an answer, I thought I would provide an alternative that probably didn't exist at the time. As an alternative to VisualVM, using Java Mission Control, which now comes with the latest JDK, you can profile and get line numbers. Line numbers aren't shown by default. You can show them in the Call Tree by right clicking on one of the tree lines and selecting "Distinguish Frames By >> Line Number".

like image 199
twm Avatar answered Oct 02 '22 15:10

twm