An Oracle blog about NetBeans Profiler

Five VisualVM Myths Demystified

VisualVM has been released more than one year ago and since then several myths appeared around the tool without any real basis. Continue reading this article to uncover the five most frequent errors:

VisualVM is not (just) a Java profiler

Many users call the tool the "VisualVM Java profiler" and compare it with the commercial Java profilers. VisualVM is a Java monitoring and troubleshooting tool - it detects and recognizes running applications, browses their MBeans, takes thread and heap dumps, shows VM configuration and metrics and saves these information into application snapshots. It also provides basic profiling capabilities, but that's just one of the features. If you need a full-featured mature Java profiler for your daily development, check out the NetBeans profiler.

VisualVM doesn't see all Java applications

The users expect VisualVM to see at least all the locally running Java applications. Not seeing a Windows service Java process in the Applications tree is a quite often complaint. The truth is that VisualVM only lists the applications started by the same user who's running the tool. This is how the jvmstat technology used by VisualVM works, the same applications can be listed by the 'jps command. The applications not discovered by VisualVM can be added manually using a JMX connection.

VisualVM doesn't require Sun JDK

In many articles around the Web there's a note that VisualVM doesn't work with other than the Sun JDK, namely that it cannot be used on Mac. Not correct, VisualVM itself runs fine on Sun JDK 6+, Open JDK 6+, Apple JDK 6 and HP-UX PA-RISC JDK 6. Monitored applications can run virtually any 1.4+ JDK, the tool has been tested to work with Sun JDK, Open JDK, Apple JDK, JRockit JDK, IBM JDK, HP-UX PA-RISC JDK, SAP JDK and Diablo JDK. Based on the JDK version and vendor various amount of information and features is available.

NetBeans profiler isn't VisualVM integration into the NetBeans IDE

The NetBeans profiler is sometimes incorrectly mentioned to be the VisualVM integrated into the NetBeans IDE. This statement is kind of inside out, VisualVM reuses some of the NetBeans profiler's features: profiling engine, HeapWalker, threads monitor, UI components etc. NetBeans profiler has been introduced in 2004, VisualVM in 2007. The VisualVM - IDE integration is available for Eclipse and IDEA.

VisualVM-JConsole plugin is not JConsole integrated into VisualVM

"I've installed the JConsole plugin and it doesn't show any tab!" Why? Because the plugin is a container for the JConsole plugins which runs them inside VisualVM. It's not the JConsole tool itself. Typically you don't want to install the plugin at all unless you've got a custom JConsole plugin which you need to use in VisualVM.

There's one more thing which is often misunderstood about the tool - its name. It's not "Visual VM" nor "VVM", also "JVisualVM" or "jVVM" is incorrect. The only correct name of the tool is VisualVM if it's the standalone release from https://visualvm.dev.java.net and Java VisualVM when it's the JDK tool located in the bin directory.

Join the discussion

Comments ( 6 )
  • Mikael Gueck Monday, August 24, 2009

    Every time I've tried VisualVM, it has crashed the vanilla Sun JVM I've used it on. Every time.

  • Jiri Sedlacek Monday, August 24, 2009

    Have you filed a bug report? If not, you can do it at https://visualvm.dev.java.net/issues/enter_bug.cgi?issue_type=DEFECT - just describe your steps and attach the VisualVM logfile (Help | About | Logfile) and JVM crashlog. We'll be happy to fix it.

  • Chris M Monday, August 24, 2009

    It would be nice if VisualVM could connect to a process by pid like jstack does. I often have to investigate Windows services and don't have access to enable JMX. Otherwise it's a great tool.

  • Jiri Sedlacek Monday, August 24, 2009

    VisualVM internally uses the same technology as jstack to take thread dumps from local applications. If your environment is setup to take thread dumps using the jstack, it will also work from VisualVM (locally running jstatd will be supported in the upcoming VisualVM release). Check out this article for more on monitoring Windows services: http://blogs.sun.com/nbprofiler/entry/monitoring_java_processes_running_as.

  • Mikael Gueck Tuesday, August 25, 2009

    So I decided to try it again, since you're advertising, so I attached visualvm to my netbeans process. Just clicking on the CPU profiling button crashed the netbeans jvm. The visualvm progress dialog remained entirely grey through the whole time, and even after visualvm gave up connecting to the crashed jvm, the progress dialog remains up and grey.

  • Jiri Sedlacek Tuesday, August 25, 2009

    Mikael, there's really no way to help you without the VisualVM logfile & JVM crashlog. I don't think things will start working for you magically without any change/fix.

Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.