Monday Aug 24, 2009

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 and Java VisualVM when it's the JDK tool located in the bin directory.

Thursday Aug 13, 2009

Java VisualVM Blogging Contest Results Announced

The Java VisualVM Blogging Contest results have (finally!) been announced at Congratulations to the winners and a big thank you to all participants!

Thursday Jul 23, 2009

Two Tricks On Using VisualVM

This blog describes two useful tricks on using the VisualVM tool. They won't find a performance bottleneck or memory leak for you but definitely will make using the tool even easier:o)

Doubleclick to invoke default action in the Applications tree!

Each node in the Applications tree can define some actions which are displayed in it's right-click popup menu. There may be one action in the menu which is displayed in bold which means it's a default action. Default action is typically the most useful action for the node and can be invoked immediately by doubleclicking the node or pressing Enter for the selected node. What's this good for? You can easily open an application or Local host using their node, add a new host using the Remote node, add a core dump using the VM Coredumps node or add an application snapshot using the Snapshots node.

Hold down the CTRL key when taking a snapshot to not open it!

By default if you take some kind of snapshot in VisualVM it's immediately opened. Sometimes this is not what you want, maybe you just want to take a heap dump and save it for later investigation. How to suppress the automatic opening of the snapshot? By holding the CTRL key down when invoking the Take Snapshot action. This works for taking the thread dumps, heap dumps, profiler snapshots and application snapshots across the VisualVM UI.

Monday Jun 29, 2009

NetBeans IDE 6.7 Released

The NetBeans IDE 6.7 has been released at News in this release are listed in NetBeans IDE 6.7 Release Information, release notes are available here.

The profiler enhances heap analysis capabilities by supporting the OQL scripting in the HeapWalker (hit F1 in the OQL Console to get a detailed help), computing retained sizes for each instance on the heap and listing first N largest objects by retained size. The Overview tab introduces information about number of objects pending for finalization and thread call stacks at the heap dump if available.


The other major profiler improvements include support for exporting profiler results (live results, profiler snapshots, telemetry data) to CSV, HTML and XML and the self-profiling service called "Profile Me Now!" which helps to debug IDE performance problems.

To get a summary information about new profiler features and bugfixes see the NetBeans profiler 6.7 Release Notes.

Tuesday Jun 23, 2009

New Plugin for VisualVM - Buffer Monitor

Buffer Monitor Plugin monitors the resources associated with pools of buffers. Plugin can monitor direct buffers that are allocated outside of the garbage-collected heap (by ByteBuffer.allocateDirect), and memory-mapped buffers, created by mapping a region of a file into memory (using The plugin uses newly added java.nio.BufferPoolMXBean to monitor the buffers usage. BufferPoolMXBean is available only in JDK 7 (build 36 and newer), so if you want to use this plugin, your monitored application must run on the latest JDK 7 build available here. More details about buffer pools monitoring are available in Alan Bateman's blog. The plugin is available at VisualVM 1.1.1 plugin center.

Tuesday Jun 16, 2009

Java VisualVM Now Available in Mac OS X

Apple released Java VisualVM as part of Java for Mac OS X 10.5 Update 4. To launch Java VisualVM, run jvisualvm from the command line. This Java update is available via Software Update and manual download from

There is Getting Started with VisualVM for those those who want to get more information about the tool.

Thursday Jun 04, 2009

JavaOne 2009 Slides: Monitoring and Troubleshooting Java Platform Applications with JDK Software

On June 3rd there was a "Monitoring and Troubleshooting Java™ Platform Applications with JDK™ Software" (BOF-4724) session held at JavaOne 2009. The presentation mentioned monitoring and troubleshooting tools available in JDK, several demos presented how typical problems of Java applications can be detected and debugged using the VisualVM tool. Many attendees requested the slides to be made available online, many others who didn't make it to JavaOne this year may be interested in the contents. Click the image below to get the slides:

You may also download the sources for presentation demos, the NetBeans project archive is available here.

Monday Jun 01, 2009

Exporting Data From Profiler

Until NetBeans 6.7M3 the only way data could be exported from profiler was through profiler snapshot (.nps). The catch is, that profiler snapshot can't be opened by external applications like spreadsheet or browser. For this reason we decided to add ability to export data to other formats:

  • CSV - For analysis in spreadsheet
  • XML - For automated analysis
  • HTML - For quick and easy visualization in browser

The feature is available for both live results and snapshot for CPU and Memory profiling. In addition the raw data for VM Telemetry graphs can be exported too. It is accessible through the “Export to...” button in toolbar of each view.

Note that for all snapshots the profiler snapshot file (.nps) is always the default choice so there is no need to change workflow in case this feature is not interesting for you.

Thursday May 28, 2009

JDK 6 Update 14 Includes Latest VisualVM 1.1.1

The just released JDK 6u14 includes the latest version of the VisualVM tool. According to the Release Notes there are many improvements and bugfixes in the tool since the JDK 6u13:

  • CPU usage and GC activity graph in the Monitor tab
  • Table view in the Threads tab
  • Command line options: --openpid, --openjmx, --openfile
  • Compare Memory Snapshots action in the context menu
  • Copy To Clipboard / Save To File buttons in the About dialog
  • Monitoring IBM JVM via JMX connection
  • Based on NetBeans Platform 6.5 and NetBeans Profiler 6.5
  • Faster computation of references, and improved readability of path to GC root in HeapWalker
  • Improved integration of the Visual GC tool
  • List of bugfixes

Note that there's a Java VisualVM Blogging Contest in progress, you can win USD $500 if you try the tool and blog about your experience with it.

Thursday Apr 23, 2009

Java VisualVM Blogging Contest

Java VisualVM Blogging Contest has been announced and started at If you enter the contest and blog about either the opensource VisualVM tool or Java VisualVM tool available in your JDK/bin folder you can win up to USD $500:

Try Java VisualVM for a Chance to Win USD $500!
Java VisualVM is a free tool to monitor, profile, and control Java technology-based applications. Try it and blog about it for a chance to win USD $500. » Get Started Now

The blogging contest starts on April 23rd, 2009 and ends on June 24th, 2009. You can enter the contest using the Submit link on the Blogging Contest page. See more information about the contest in Blogging Contest FAQ, official contest rules are available here.

All the information you need to get started with VisualVM is available in the VisualVM Documentation and Resources, you can also check the Java VisualVM documentation. Useful tips on using the tool are mentioned on NetBeans Profiler (this) Blog, great docs about extending the tool can be found on Geertjan's Blog.

Searching for some inspiration? You can check what the others already wrote about VisualVM. Happy blogging and good luck!

Wednesday Apr 01, 2009

VisualVM 1.1.1 Multi-Language Release

The multi-language version of VisualVM 1.1.1 has been released at The tool has been translated to Japanese (ja) and Simplified Chinese (zh_CN). Also the Introduction to VisualVM (ja, cn) and Getting Started with VisualVM (ja, cn) documents have been translated. The bits are available for download here.

If using appropriate locales in your OS (ja or zh_CN), the tool should start with localized messages automatically. If you don't use one of these locales and still want to use the localized tool, you can use a special command-line switch to start VisualVM:

  visualvm --locale ja
  visualvm --locale zh:CN
If you have already used the not localized VisualVM 1.1.1 tool, you may need to delete the VisualVM user directory (Help | About | Details | Userdir) to have all the strings correctly localized.

Thursday Feb 26, 2009

OQL support in the HeapWalker

With the arrival of the NetBeans 6.7M2 release the HeapWalker is enhanced with the OQL (stands for Object Query Language) support for analysing the heap-dump contents.

The OQL specifications are particularly complex and there is no complete implementation of the specifications yet. What more, there are various implementations enhancing the original OQL with their own additions. For the sakes of compatibility the jHat OQL implementation was chosen as the query engine for the HeapWalker. This decision also makes it possible to enhance the analytical capabilities of the OQL by custom JavaScript functions.

The actual OQL implementation comprises of the query engine and the visual console embedded within the HeapWalker. The visual console offers basic OQL language syntax highlighting and code completion. It also provides a contextual help linking to the rather exhausting jHat OQL documentation explaining the basics of the OQL as well as providing many working examples. The query results are bound back to the rest of the HeapWalker for the ease of navigation.

Demo of the OQL integration can be seen here.

Monday Feb 23, 2009

Visual GC Plugin 2.0 for VisualVM

The recently released VisualVM 1.1.1 introduced an updated Visual GC tool integration into VisualVM. From today the Visual GC Plugin 2.0 is also available for all other VisualVM and Java VisualVM releases via the Plugin Center.

Visual GC is an experimental Visual Garbage Collection Monitoring Tool - a graphical tool for monitoring the HotSpot Garbage Collector, Compiler, and class loader. The tool was originally developed as demonstration software for JavaOne 2001 where it was used in a presentation to help describe how various tunable parameters affect the operations of the HotSpot generational garbage collector. In 2004 it was presented in technical session Using jvmstat and visualgc to Solve Memory Management Problems.

Detailed information on using the Visual GC tool can be found on the Visual GC page. The latest standalone Visual GC tool can be downloaded here.

Using the Visual GC plugin for VisualVM has several advantages over the standalone tool:

  • No command-line launcher. The standalone tool has to be launched from a command-line with at least one argument specifying the PID of the Java process to be monitored. When using the VisualVM plugin, the Visual GC GUI is displayed in a separate subtab for each application.
  • Remote monitoring without any special setup. When the jstatd daemon is already running on a remote server to enable the VisualVM to discover running remote Java applications, no special setup is required for Visual GC to monitor these applications.
  • More user-friendly UI. The plugin changes the default Visual GC appearance to fit into VisualVM UI and provide better user experience. The most significant change is using white background instead of the default black. Changing the background color also required to change the graphs colors. The Application Information section has been removed - the information is already available in Overview subtab of each application. The plugin also sets default font for the labels, fixes several layout problems and allows to configure the refresh rate during runtime. Note that all these customizations can be switched off by starting VisualVM with a special argument


To install the Visual GC plugin for VisualVM, use Tools | Plugins in VisualVM menu bar and select the 'Available Plugins' tab. Alternatively, if previous version of the plugin is already installed, the updated plugin will be displayed in the Updates tab. You may need to click the 'Reload Catalog' button to refresh the available plugins if the older plugin version (1.1.1) is cached.

When installed, the Visual GC subtab is added for each Java application. The graphs are available for all applications running Sun JDK 1.4.2+ with jvmstat available - this means that both local and remote applications can be monitored without any limitations (jstatd daemon must be running on remote hosts). The Histogram view may or may not be displayed by default depending on the application configuration - when the monitored VM uses Parallel Scavenge collection (using Server VM or setting -XX:+UseParallelGC or -XX:+AggressiveHeap), Histogram view is hidden by default.

The refresh rate of Visual GC graphs is customizable during runtime, it can be changed using the Refresh Rate dropdown. The value is specified in milliseconds and the default value is Auto which means using the global refresh rate defined in Tools | Options | Polling - Monitored Data.

Tuesday Feb 17, 2009

VisualVM 1.1.1 Released

VisualVM 1.1.1 tool has been released at This version delivers several important bugfixes and improves memory monitoring capabilities.


The most significant news are two plugins available on VisualVM 1.1.1 Plugin Center:

  • Memory Sampler plugin: this plugin periodically polls the monitored application and lists classes, instances and live bytes allocated on Heap and PermGen. This is almost the same information as provided by live memory results of the built-in profiler but without any instrumentation and available for multiple applications at the same time. An advantage over the built-in profiler is the possibility to display delta values between the samples. Note that this plugin only works with local Java applications running Sun JDK 6 or 7.
  • Improved Visual GC plugin: the Visual GC tool integration into VisualVM has been improved, the graphs are now displayed in a subtab for each monitored application. It works for both local and remote applications where jvmstat is available (jstatd must be running on remote hosts). Note that this plugin works only with Sun JDK 1.4.2 and newer.

The most important bugfixes are:

  • Issue 233: fixed compatibility problems with JDK 6 Update 12, VisualVM now works correctly with this JDK even without the VisualVM-Extensions plugin.
  • Issue 242: CPU utilization chart in Monitor tab introduced in VisualVM 1.1 has been fixed to display correct values on multiprocessor systems.

To get more information about the tool, download it and start using it, visit the project pages at If you want to provide some feedback to VisualVM developers, let them know on a mailing list.

Thursday Feb 05, 2009

VisualVM Updated To Correctly Recognize JDK 6 Update 12

A problem has been identified in VisualVM this week, the tool is unable to handle the recently released JDK 6 Update 12. It's caused by an updated HotSpot version (11.2), VisualVM doesn't recognize it and fails to detect any running Java application if at least one application is running the 6u12.

Today a fix for this problem has been released for VisualVM 1.1, it's delivered by the VisualVM-Extensions plugin via the Plugin Center. If you haven't installed the plugin yet, use Tools | Plugins | Available Plugins to download and install the plugin. If previous version of the plugin is already installed, you can get the update using Tools | Plugins | Updates. If you cannot connect to the Plugin Center (firewall etc.), you can download the plugin file manually and install it using Tools | Plugins | Downloaded.

In the following days the fix will be available also for the previous VisualVM and Java VisualVM releases. Till then you should use the patched VisualVM 1.1, also the Java VisualVM bundled with JDK 6 Update 12 works fine.

Updated: the fix is now available on Plugin Center for each affected VisualVM / Java VisualVM version.


A blog by NetBeans Profiler & VisualVM developers.


« July 2016