Monday Jun 29, 2009

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.

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 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.

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 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.

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 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:

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 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 ja
or
  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 -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.

Tuesday Feb 17, 2009

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.

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.

Thursday Jan 22, 2009

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:

  1. Get the instsrv.exe and srvany.exe tools if you don't have them already, they are for example part of the Windows Server 2003 Resource Kit Tools.
  2. Create a Windows service to launch the VisualVM using this command:
       c:\\wrk\\instsrv.exe VisualVM c:\\wrk\\srvany.exe
    This will create a new srvany service (a wrapper service to start any executable) called VisualVM. General instructions on creating new Windows services are available here.



  3. Using a registry editor (regedit.exe, regedt32.exe) create a new Key called Parameters in HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\VisualVM. Then inside the Parameters key create a new String value (REG_SZ) called Application containing a full path to visualvm.exe. This will instruct the srvany service to start VisualVM.



  4. 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:

  1. Get the instsrv.exe and srvany.exe tools if you don't have them already, they are for example part of the Windows Server 2003 Resource Kit Tools.
  2. Create a Windows service to launch the jstatd.exe using this command:
       c:\\wrk\\instsrv.exe jstatd c:\\wrk\\srvany.exe
    This will create a new srvany service (a wrapper service to start any executable) called jstatd. General instructions on creating new Windows services are available here.



  3. Using a registry editor (regedit.exe, regedt32.exe) create a new Key called Parameters in HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\jstatd. Then inside the Parameters key create a new String value (REG_SZ) called Application containing a full path to jstatd.exe and security parameters. This will instruct the srvany service to start the jstatd daemon. See the jstatd man page for details on setting up the daemon.



  4. 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.exe is 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.

Wednesday Jan 14, 2009

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!

About

A blog by NetBeans Profiler & VisualVM developers.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today