Using VisualVM with IntelliJ
Asked Answered
B

1

25

I'm trying to use VisualVM with IntelliJ to profile a Java application. I have the VisualVM Launcher plugin installed inside of IntelliJ. I press the play button with the orange circle in IntelliJ that launches VisualVM and opens the process when I start the run. However, when I try to profile the CPU, it doesn't seem to profile the methods in my program. I've tried with several different programs and can't seem to get any of them to work with VisualVM. This is what VisualVM looks like this:

enter image description here

The profiler seems to think that the total time is 857 ms or 6.21 ms when in reality my program takes about a minute to run. It seems to be capturing "DestroyJavaVM" which is not my program. I'm using VisualVM because it is the only free Java profiler I could find. Any suggestions? Here are my VisualVM settings:

enter image description here

Breannabreanne answered 4/2, 2017 at 19:31 Comment(4)
A guss is that BankSim should be fully qualifiedCarapace
I'm not using packages. I tried putting it in a package and fully qualifying the class name with the same results.Breannabreanne
Try putting it in some package like abc and have abc.** in tab "Start Profiling from classes" (the place where you have put BankSimSleety
Before your program starts, put a System.in.read(),and when it stops, press de "Profile CPU" in VisualVM and then enter in the app.Vitriform
M
2

As others have suggested, take a look at your "Start profiling from class" setting.

But you might want to consider it being a timing issue. As you can see in the background, the process you want to debug is already finished.

Check in the call tree and in the list of processes to the left what you are debugging. In your screenshot you are debugging the destruction of the JVM. That does not include your code, so you should not see it there.

Macruran answered 23/8, 2018 at 13:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.