VisualVM, BTrace, and GlassFish

VisualVM is pretty much a better jconsole (which itself was already a huge step forward).

It’s come a long way since I first mentioned it and 1.0 is now around the corner. The tool brings the telemetry & monitoring features of jconsole together with the dynamic profiling from NetBeans. You can look at a quick demo in James Gosling’s general session from JavaOne 2008, it’s the first one.

VisualVM supports .hprof heap dumps, full snapshots but you need to remember that various features depend on the Java versions used in the client and the server (check out the Feature Matrix on the project homepage). For instance, while the tool requires Java 6, it can monitor 1.4.2 JVMs (including non-Sun JVMs). On the other hand, profiler and Heap/Thread dumps do require Java 6 for the monitored application.



As always, what makes an open source product really interesting is its plugin architecture and the catalog of additional features it brings. Here’s a list of existing plugins: VisualGC (which never had an equivalent in jconsole), MBeans, JMX, Thread Dump Analyzer (TDA), BTrace, and GlassFish.



GlassFish plugin for VisualVM:

This extension enhances monitoring of GlassFish-hosted applications by adding specialized overview, a tab for monitoring HTTP Service and the ability to visually select and monitor any of the deployed web applications.






So far VisualVM profiling performance is good. In the case of GlassFish, only a subset of the large amount of class files loaded in memory are actually instrumented by default.

Btrace

Btrace is essentially a portable DTrace – a safe (read, not write), low-overhead, probe-based dynamic tracing tool.
Check out JavaOne slides. Btrace offers annotations (@OnMethod, @OnTimer, @OnEvent, @OnExit, @OnError, @OnLowMemory) to define what could be considered as troubleshooting interceptors (“probe points”).

The BTrace samples are a good place to get an idea of how flexible and powerful this can be (bottom of the page).

A VisualVM plugin for BTrace is in the works.

Author: alexismp

Google Developer Relations in Paris.

2 thoughts on “VisualVM, BTrace, and GlassFish”

  1. "while the tool requires Java 5," – Hi Alexis! VisualVM actually requires Java 6 in order to run, but as you point out, it can monitor applications that are running on 1.4.2, 5, or 6. HTH- Gregg.

Comments are closed.