I suppose this question is strongly related to this , but it is closed, and the solution seems to me unclear.
I am trying to use VisualVM to profile a Scala console application. I do this by starting VisualVM, starting the Scala application, opening its node in VisualVM, going to the Profiler tab and clicking on CPU. The button turns gray for some time (as long as the status never changes to any of the "inactive profiling"), and then back active, but the profiling data is not displayed.
The application does some file reading, data processing (which takes about a minute), data output and stdout outputs. I also tried adding Thread.sleep(60000)to the beginning and the end of the program to provide enough time for VisualVM to capture it and complete the task, but nothing has changed.
Unlike the related question I'm connected to, I do not start my application from Eclipse or anything else - I use the following command line to launch it:
java -classpath myapp.jar:lib
all libraries (including scala-library.jar) are placed in lib/. The application works as expected.
Update:
- I tried YourKit Java Profiler 11.0.2 and with an error
AttachNotSupportedException. - I was able to manually add an agent using YourKit .
- , , IDE ( ), - JVM, classpath. , JVM /. , , .
:
- YourKit Java Profiler 11.0.2
- VisualVM 1.3.4
- SBT 0.12.3 ( , ( ))
- Scala 2.9.2
- Oracle Java 1.7.0_04-b20
- XUbuntu Linux 12.04 32- i386
- Linux 3.2.0-24-generic-pae