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
jstatddaemon 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
-J-Dcom.sun.tools.visualvm.modules.visualgc.originalUI=true.
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.
VisualVM 1.1.1 Released
VisualVM 1.1.1 tool has been released at https://visualvm.dev.java.net. 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 https://visualvm.dev.java.net. If you want to provide some feedback to VisualVM developers, let them know on a mailing list.
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.
Monitoring Java Processes Running As a Windows Service
This post describes how Java processes running as a Windows service can be monitored and/or profiled using VisualVM. By default, when you start VisualVM only Java applications started by the same user are listed in the Applications tree. But sometimes you may need to monitor or profile for example Tomcat running as a Windows service. There are several ways to do it using VisualVM:
Using JMX connection
pros: easy to setup
cons: profiling not available
JMX connection can be used to monitor any local/remote Java application in VisualVM incl. the locally or remotely running Java services. All you need to do is to start the service to be monitored with some extra arguments defining JMX connection parameters. Details on how to setup a JMX-enabled application are available here. Once started, you can connect to the application using the Add JMX Connection action. Drawback of this solution is that you cannot profile applications defined by JMX connection, only the monitoring features are available.
Running VisualVM as a service
pros: allows profiling services
cons: not available on Windows Vista
Since only Java processes running under the same user as VisualVM can be profiled, the only way to profile Windows service (which is by default running under the System account) is to start the VisualVM itself as a Windows service. Note that this approach doesn't work on Windows Vista due to security restrictions which by default prevent the services to display any UI. If you have appropriate permissions (ideally perform as Administrator) follow these steps:
- Get the
instsrv.exeandsrvany.exetools if you don't have them already, they are for example part of the Windows Server 2003 Resource Kit Tools. - Create a Windows service to launch the VisualVM using this command:
c:\wrk\instsrv.exe VisualVM c:\wrk\srvany.exe
This will create a newsrvanyservice (a wrapper service to start any executable) called VisualVM. General instructions on creating new Windows services are available here.
- Using a registry editor (
regedit.exe,regedt32.exe) create a new Key calledParametersinHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\VisualVM. Then inside theParameterskey create a newStringvalue (REG_SZ) calledApplicationcontaining a full path tovisualvm.exe. This will instruct thesrvanyservice to start VisualVM.
- Make sure the service is configured to run under Local System account with 'Allow service to interact with desktop' option enabled. Also, it's a good idea to set the service Start up type to Manual.

Once you have performed the steps, you can simply start the VisualVM service which will launch the tool in context of System account. After confirming the VisualVM license dialog you should see all the running Java services in Applications tree and all the features incl. profiling should be available.
Running jstatd as a service
pros: automatic discovery of remote services
cons: profiling not available, works only remotely
Instead of running the VisualVM itself as a service, you can run the jstatd daemon as a service. This will make all running Java services visible to the jvmstat technology used by VisualVM to automatically discover Java applications. Note that you cannot use this approach for monitoring locally running Java services, it only works remotely. In general, the steps are exactly the same as for running VisualVM itself as a service:
- Get the
instsrv.exeandsrvany.exetools if you don't have them already, they are for example part of the Windows Server 2003 Resource Kit Tools. - Create a Windows service to launch the
jstatd.exeusing this command:
c:\wrk\instsrv.exe jstatd c:\wrk\srvany.exe
This will create a newsrvanyservice (a wrapper service to start any executable) called jstatd. General instructions on creating new Windows services are available here.
- Using a registry editor (
regedit.exe,regedt32.exe) create a new Key calledParametersinHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\jstatd. Then inside theParameterskey create a newStringvalue (REG_SZ) calledApplicationcontaining a full path tojstatd.exeand security parameters. This will instruct thesrvanyservice to start thejstatddaemon. See thejstatdman page for details on setting up the daemon.
- Make sure the service is configured to run under Local System account. Note that the 'Allow service to interact with desktop' option doesn't need to be enabled as
jstatd.exeis a command-line tool without any UI. Also, it's a good idea to set the service Start up type to Manual.
Once you have performed the steps, you can simply start the jstatd service and the host as a new host in the remote VisualVM. All the Java services should then be displayed under the host node in Applications tree. Details on monitoring remote applications are available here. Note that profiling won't be available for these applications.
NetBeans Profiler is The Development Utility of The Year 2009
The NetBeans profiler developers are proud to announce that the profiler won the Development Utility category in the Developer.com Product of the Year 2009 Awards. We would like to thank all of you who voted for the profiler and to all the profiler users for their support!
Moreover, this is also a great success for the VisualVM tool and its users, since it's building on top of the NetBeans profiler and the NetBeans Platform, which won the Development Tool category.
Java VisualVM Screencast
A screencast of the Java VisualVM tool has been published at http://java.sun.com, direct link to the flash video is here.
If you haven't tried VisualVM yet, this is a great opportunity to see the tool in action. And if you like it, getting started is really easy - it's already in your JDK installation (since JDK 6 Update 7), just launch bin/jvisualvm!
New Command-Line Options in VisualVM 1.1
Recently released VisualVM 1.1 tool introduces three new command-line options: --openfile, --openpid and --openjmx. These options allow to use VisualVM as an application or file viewer. This can be handy especially for viewing heap dumps and thread dumps or for integration with third-party tools.
A nice feature of VisualVM command-line support is the ability to reuse already running VisualVM instance. If you request to open a file for the first time, VisualVM is launched and the file is opened. If you request to open another file, it will be opened in the tool which is already running. This is possible thanks to the NetBeans Command Line Parsing API used by this feature.
The --openfile option
syntax: visualvm --openfile [filename] where filename is full path to a supported file
allows to open a supported file in VisualVM. Supported are the same file types as in the Load dialog in VisualVM GUI - by default thread dumps (.tdump), heap dumps (.hprof) and profiler snapshots (.nps) are supported. Since the heap dumps are recognized by the file header and not just according to their extension, also .bin and other heap dumps can be opened by VisualVM. If a third-party tool adds support for another file type, it will be automatically available also from the command-line.
The --openpid option
syntax: visualvm --openpid [pid] where pid is process id of running Java application
allows to open local Java process in VisualVM. This is an alternative to the Open action in VisualVM GUI. Note that there's a predefined timeout 5sec for which the VisualVM waits for the PID to become available - this allows to start VisualVM along with the monitored application. The --openpid option may be used for example in batch commands for monitoring several predefined applications (application servers etc.) or for integration with third-party tools (like the integration module for the Eclipse IDE).
The --openjmx option
syntax: visualvm --openjmx [hostname:port] where hostname:port defines the JMX connection
allows to connect to local or remote Java process using the JMX connection. This is an alternative to the Add JMX Connection action in VisualVM GUI. JMX connection defined from the command-line is not restored after restarting VisualVM. The --openjmx option may be used for example in batch commands for monitoring several predefined applications (application servers etc.) or just like a simple remote application monitor/viewer.
Profiler Update in Patch1 for NetBeans IDE 6.5
The recently released Patch 1 for the NetBeans IDE 6.5 delivers several important profiler bugfixes. If you are using the NetBeans profiler, we strongly recommend you to apply this update.
VisualVM 1.1 Released
New version of the VisualVM tool has been released. VisualVM 1.1 introduces many new features and improvements, extends the API for plugins and delivers a complete JavaDoc documentation. Now integrates with the Eclipse IDE and IntelliJ IDEA!
These are the new features of VisualVM 1.1 as mentioned in the Release Notes:
- Monitoring CPU usage and Garbage Collector activity for each application in the Monitor tab
- Table view in the Threads tab (introduced by the NetBeans profiler 6.5)
- Three commandline options to enable using VisualVM as an application or snapshot viewer:
--openpid <pid>starts VisualVM if not already running and opens a Java application with the process id--openjmx <hostname:port>starts VisualVM if not already running and opens a Java application defined by a JMX connection--openfile <file>starts VisualVM if not already running and opens a supported file (*.tdump, *.hprof, *.nps, *.apps)
- Compare Memory Snapshots action available in Applications window context menu for two selected comparable snapshots
- About dialog allows to copy configuration information to clipboard and save the logfile to an external file
- IBM JVM can be monitored by VisualVM using a JMX connection
- Eclipse integration plugin which starts VisualVM along with the monitored application directly from the IDE
- Integration with IntelliJ IDEA is already available, see the Profiler Plugin by Esko Luontola
- Experimental support for HP-UX PA-RISC platform (incl. profiling)
The last significant change is using the latest NetBeans Platform and profiler 6.5 - this means many framework and profiler bugfixes being available also in VisualVM.
VisualVM 1.1 can be downloaded at https://visualvm.dev.java.net. Feedback to VisualVM developers can be sent using this mailing list. The online JavaDoc documentation can be found here. Note that there's also a Releases Overview page available which lists all VisualVM releases and shows which VisualVM version is included in JDK as Java VisualVM.
JDK 6 Update 11 Comes With Updated Java VisualVM
The JDK 6 Update 11 has been released today, it contains an updated version of the Java VisualVM tool based on the most recent VisualVM 1.0.1. If you are using the Java VisualVM tool we suggest you to get the latest JDK bits at http://java.sun.com/javase/downloads/index.jsp and update your installations. This way you will get the latest VisualVM bugfixes and improvements.
Developer.com Product of the Year 2009: Give Us Your Vote!
The Product of the Year 2009 awards are in progress at Developer.com, you can vote till Monday, December 15, 2008. If you like the NetBeans profiler or VisualVM tool, please give us your vote in the Development Utility of the Year category!
NetBeans IDE 6.5 Released
Today the NetBeans IDE 6.5 has been released at http://www.netbeans.org. In this version the profiler introduces some new features, the most significant are:
- Profiler remote packs are generated by the Attach Wizard, no additional downloads are needed for remote profiling
- HeapWalker tool got significant performance improvements and some usability tweaks
- Table view has been added to the threads monitor
In the 6.5 release the profiler also adds an experimental support for HP-UX (PA-RISC 32bit, 64bit) and Phone ME Advanced (Windows x86, Linux x86) platforms. Also, almost 100 bugs have been fixed to deliver the best quality product.
A good starting point for new profiler users is the Introduction to Profiling Java Applications in NetBeans IDE document. Experienced profiler users will appreciate the new document describing Profiling Points feature: Using Profiling Points in NetBeans IDE.
To get a general information about the new NetBeans IDE release see the NetBeans IDE 6.5 Release Notes. To get detailed information about new profiler features and bugfixes see the NetBeans profiler 6.5 Release Notes.
VisualVM in Ubuntu 8.10
The new version of Ubuntu (8.10 aka Intrepid Ibex) was released yesterday. Because I heard of many improvements in this version I immediately got a copy and installed it. The overall impression is awesome! And the best of all - VisualVM is available as an Ubuntu package right from the Canonical repositories.
Just open the Synaptic Manager, type "visualvm" in the quick-search box (btw, this is the best thing since sliced bread ;) and you can install VisualVM with all the dependencies. The download size is quite hefty (cca. 300MB) since it downloads the whole open-jdk, mysql and i-dont-know-what-else but in the end you have full-blown java development environment with the bonus of VisualVM nicely registered under "Applications/Programming/VisualVM" menu shortcut.
What is left now is to port some Ubuntu specific monitoring stuff to VisualVM plugins. Any volunteers? :)
VisualVM 1.0.1 Released
VisualVM 1.0.1 tool has been released at https://visualvm.dev.java.net. This is mostly a bugfix release based on the VisualVM 1.0.
According to the Release Notes document these changes have been made:
- Profiler supports OpenJDK
- Profiler is silently disabled on unsupported platforms, the rest of the tool can run unaffected
- Minor improvements of warning messages in the tool and plugins to better describe reported problems
- New plugins available on the Plugin center: JvmCapabilities, KillApplication, SysTray
To get more information about the tool, download it and start using it, visit the project pages at https://visualvm.dev.java.net. Information about the new plugins can be found on the Plugins page. If you want to provide some feedback to VisualVM developers, let them know on a mailing list.
Hg Repository and Continuous Build
Like all other NetBeans development teams, Profiler team has to use mercurial (hg) from February. Since the traffic and number of broken builds in main NetBeans repository is alarming, we asked our release engineering to set up separate NetBeans Profiler mercurial repository called profiler-main and continuous build. We update profiler-main once a day from main-golden. Main-golden is updated from main only if it can be built successfully and the basic set of tests passed. This way we can work on relatively stable build of NetBeans. When fixing bugs we first push changeset to profiler-main and corresponding bug is closed as FIXED in IssueZilla, than the fix is propagated to main and from main finally to main-golden. Corresponding issue is automatically updated with information about public build. If you don't want to wait for fix to be propagated to main-golden you can download NetBeans with fix from our continuous build.









