Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Plugin for Serviceability Agent in VisualVM

DZone's Guide to

Plugin for Serviceability Agent in VisualVM

· Java Zone
Free Resource

Learn how to troubleshoot and diagnose some of the most common performance issues in Java today. Brought to you in partnership with AppDynamics.

I am a Staff Engineer at Sun Microsystems, Bangalore. I have been with Sun for almost 9 years now, working in Java Sustaining Group. My primary responsibility here is to work on customer escalated problems against Java platform. Apart from this, I often get a chance to work on RFE (Request For Enhancement)/bugs in the developement release, which currently is jdk7. I love troubleshooting and resolving problems, and my area of expertise is Hotspot VM.

Serviceability Agent 

As part of my job, I need to debug/analyze Java processes and Core/Crash Dump files resulting from JDK or HotSpot crashes and hangs. Most of the time, the problem occurs at the customer site and what we get to look at is only the Core file. Serviceability Agent (aka SA) comes to the rescue there. It is an out-of-process snapshot debugger for the Hotspot Java Virtual Machine. I use SA for analyzing and digging data from both Core files and Processes.

SA Plugin for VisualVM

VisualVM is a powerful troubleshooting tool that is targeted at providing all possible Java and JVM debugging and troubleshooting utilities in one place. So I thought it would make sense to provide the useful features and utilities of Serviceability Agent too in this All-in-One Troubleshooting tool.

What are this plugin's main features?

SA-Plugin brings powerful features of Serviceability Agent to VisualVM. Like SA, this works with both live Processes and Core files. It makes SA utilities available in VisualVM in the following four panels:

Java Threads / Java Stack Trace

  • It shows all the Java Threads in the process.
  • Double click on any thread or clicking on the 'Open Inspector' icon on Java Threads Panel shows internal details of the thread object in another 'Oop Inspector' panel.
  • It also shows Java Stack Trace of any Java Thread.

This is how it looks

 Java Threads

Oop Inspector

  • This is a very useful feature. All the java objects in hotspot VM are represented as Oops - 'Ordinary Object Pointer' and the 'Oop Inspector' panel can show details of these Oops in Java Heap. The ability to see all the internal fields of any java object provides a great debugging help.
  • This also provides the ability to 'compute the liveness' of any Oop in the Java Heap.
Oop Inspector

Memory Viewer

  • Shows values at any address in the Java Heap
Memory Viewer

Find Panel

This feature helps one find any address in Java process/core. Find Panel has three sub-tabs.

  • Find Address in Heap: Shows where all the given address is assessed in Java Heap
  • Find Address in CodeCache : Shows where all the given address is assessed in Compiler's codecache.
  • Find Pointer: Find where a pointer lies in Java Heap. e.g Address 0x10100088: In new generation eden [0x10010000,0x1001e950,0x100f0000) space capacity = 917504, 6.509835379464286 used from [0x10100000,0x10110000,0x10110000) space capacity = 65536, 100.0 used to [0x100f0000,0x100f0000,0x10100000) space capacity = 65536, 0.0 used
Find Address

 

JDK versions supported

  • 1.7.0-b64 and later on all platforms.
  • 6u17 and later on Solaris and Linux (SA binaries are not yet shipped with jdk6 on Windows) 

Go here for all the information on installing and getting started with this VisualVM plugin:

https://visualvm.dev.java.net/saplugin.html

Understand the needs and benefits around implementing the right monitoring solution for a growing containerized market. Brought to you in partnership with AppDynamics.

Topics:

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}