VisualVM 1.2.1 Released
VisualVM 1.2.1 has been released to fix compatibility issues with JDK 6 Update 17 (and newer) and several other problems:
- Issue 333: HeapWalker in VisualVM doesn't work with JDK 6 Update 17+
- Issue 327: Maximum value in Monitor charts is Integer.MAX_VALUE
- Issue 332: NPE in VisualVM-Sampler
See the Release Notes for more details. VisualVM 1.2.1 can be downloaded at https://visualvm.dev.java.net.
VisualVM 1.2 Released
New version of the VisualVM tool has been released. VisualVM 1.2 introduces many new features and improvements, extends the API for plugins and fixes many bugs.
These are some of the new features as mentioned in the Release Notes:
- Sampling CPU and Memory profiler plugin
- Support for multiple
jstatdconnections on a single local/remote host - New charts with dynamic tooltips, public Charts API for plugins
- Monitor and Threads tab are saved into Application Snapshot
- Properties UI for Applications, Hosts and Snapshots, public Properties API for plugins
- Customizable proxy settings in Options dialog
- UI for customizing SSL certificates in Options dialog
- Built on NetBeans Platform & profiler 6.7.1:
- Exporting profiler snapshots to HTML, XML and CSV
- Computing retained size in HeapWalker
- OQL scripting support in HeapWalker
- Thread stack traces at the heap dump in HeapWalker
- Improved appearance on Mac OS X
VisualVM 1.2 can be downloaded at https://visualvm.dev.java.net. Feedback to VisualVM developers can be sent using this mailing list. The API documentation can be found here.
VisualVM 1.2 Test Build Released
VisualVM 1.2 Test Build has been released at https://visualvm.dev.java.net. The developers are asking the community to help with stabilizing the release by downloading the Test Build, trying out the new features and providing feedback at feedback@visualvm.dev.java.net or filing bug reports into the Issue Tracker.
The major new features in VisualVM 1.2 will include a sampling CPU and memory profiler, enhanced support for jstatd connections, redesigned charts and much more. Details about the release with a more detailed list of improvements are available in the Release Notes document.
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.
Java VisualVM Blogging Contest Results Announced
The Java VisualVM Blogging Contest results have (finally!) been announced at http://java.sun.com/community/javavisualvm. Congratulations to the winners and a big thank you to all participants!
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.
NetBeans IDE 6.7 Released
The NetBeans IDE 6.7 has been released at http://www.netbeans.org. 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.
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 FileChannel.map). 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.
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 http://support.apple.com/downloads/Java_for_Mac_OS_X_10_5_Update_4.
There is Getting Started with VisualVM for those those who want to get more information about the tool.
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.
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.
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.
Java VisualVM Blogging Contest
Java VisualVM Blogging Contest has been announced and started at http://java.sun.com/community/javavisualvm. 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:
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!
VisualVM 1.1.1 Multi-Language Release
The multi-language version of VisualVM 1.1.1 has been released at https://visualvm.dev.java.net. 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 jaor
visualvm --locale zh:CNIf 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.
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.











