Troubleshooting Tools on Windows for Java SE 5.0

Monitoring Tools
Debugging Tools


Monitoring Tools

JConsole

Launch a GUI to monitor and manage Java applications and Java VMs on a local or remote machine.

  • Connection to Java process or host.
  • Summary of key data, for example, uptime, compilation time, objects pending finalization, and more.
  • Memory statistics, including garbage collection.
  • Request garbage collection.
  • Thread statistics.
  • Class statistics.
  • Tree structure of all platform and application MBeans.
  • Set the value of an MBean attribute.
  • Subscribe to notification for an MBean.
  • Information about the virtual machine, the compiler, the operating system.

jps

(Not currently available on Windows 98 or Windows ME platforms.)

List instrumented Java virtual machines.

jstat

(Not currently available on Windows 98 or Windows ME platforms.)

Display performance statistics for an instrumented Java VM:

  • Behavior of the class loader
  • Behavior of the HotSpot Just-in-Time compiler, totals and by method
  • Behavior of the GC heap
  • Behavior and sizes of the generation areas

jstatd

(Not currently available on Windows 98 or Windows ME platforms.)

  • Monitor for creation and termination of instrumented HotSpot Java VMs.
  • Provide an interface for remote monitoring tools to attach to Java VMs.

Debugging Tools

Heap Analysis Tool (HAT)

Parse a binary heap dump, launch a web browser, and present standard queries.

  • Execute standard queries, for example, classes, objects, class instances, reference chains from object rootset, reachable objects, and more.
  • Specify objects to exclude from "reachable objects" query.
  • Pass flags to the Java VM on which jhat is running.
  • Compare objects in two dumps.

For detailed information, see J2SE 5.0 Troubleshooting and Diagnostic Guide (pdf)

HPROF profiler

Writes class profiling information to a file or a socket, in ASCII or binary.

  • Heap allocation profiling.
  • Heap dump.
  • CPU usage - for threads, methods.
  • Monitor contention profiling.

To invoke the HPROF tool: java -agentlib:hprof ToBeProfiledClass

To print the complete list of options: java -agentlib:hprof=help

jdb

Launch a simple interactive command-line debugger.

  • Display Java objects and primitive values.
  • List currently running threads.
  • Dump the current thread stack.
  • Set breakpoints.
  • Step through execution.
  • Examine exceptions.