Setting up Sun's VisualVM on Mac OSX

Posted by: Matthew McCullough on September 8, 2008

There is a relatively new tool out from Sun call the VisualVM. It is, in short a super new version of JConsole. In fact, it even runs all the extensions you have previously written for JConsole. Nice job Sun! You can profile, take snapshots, and watch in real time, threads, memory usage, and so much more of any local or remote java application.

Now, it takes a little bit of a trick to get it to work on Mac OSX. You need the latest Java 6 JDK installed, though it can monitor apps running on JRE 1.4 through JRE 7.0. But if you don't set it as your default JDK, which can cause many apps such as Eclipse and CyberDuck to stop working, then you'll need to use the --jdkhome option when launching visualvm. I set up a shell script to do so. The full invocation is as follows:

visualvm --jdkhome /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/

There is even a getting started guide that shows you the basic features. And if video is more your style, there's a vodcast that shows off this new app as well. If you still can't get enough of this new tool, there's a neat DZone overview written by Geertjan Wielenga.

Matthew McCullough

About Matthew McCullough

Matthew McCullough is an energetic 15 year veteran of enterprise software development, open source education, and co-founder of Ambient Ideas, LLC, a Denver consultancy. Matthew currently is VP of Training at GitHub.com, author of the Git Master Class series for O'Reilly, speaker at over 30 national and international conferences, author of three of the top 10 DZone RefCards, and President of the Denver Open Source Users Group. His current topics of research center around project automation: build tools (Gradle), distributed version control (Git, GitHub), Continuous Integration (Jenkins, Travis) and Quality Metrics (Sonar). Matthew resides in Denver, Colorado with his beautiful wife and two young daughters, who are active in nearly every outdoor activity Colorado has to offer.