Troubleshooting Tools on Solaris OS and Linux for Java SE 6
Monitoring Tools
Debugging Tools
Scripting Tools
Monitoring Tools
Launch a GUI to monitor and manage Java applications and Java VMs on a local or remote machine.
- Connection to Java process, host, or JMX agent.
- Graphical overview of CPU usage, heap memory, threads, classes.
- Summary of key data, for example, uptime, compilation time, objects pending finalization, and more.
- Memory statistics, including garbage collection.
- Request garbage collection.
- Thread statistics.
- Deadlock detection.
- Class statistics.
- Tree structure of all platform and application MBeans.
- Set the value of an MBean attribute.
- Invoke operation on an MBean, for example, perform a heap dump.
- Subscribe to notification for an MBean.
- Information about the virtual machine, the compiler, the operating system.
- Pass flags to VM on which JConsole is running.
List instrumented Java virtual machines.
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
- Monitor for creation and termination of instrumented HotSpot Java VMs.
- Provide an interface for remote monitoring tools to attach to Java VMs.
Debugging Tools
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
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.
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.
- Turn on or off object allocation tracking.
- Turn on or off object reference tracking.
- Specify objects to exclude from "reachable objects" query.
- Pass flags to the Java VM on which jhat is running.
- Develop custom queries with buit-in Object Query Language.
- Compare objects in two dumps.
- Print command line flags and system properties for a running process, from a core file, or for a remote debug server.
- Dynamically set, unset, or change the value of certain Java VM flags for a process.
- Print shared object mappings for a process, a core file, or a remote debug server.
- Dump the Java heap (all objects or only live objects) of a process, a core file, or a remote debug server in binary format to a file.
- Force the Java heap dump of a process if the process does not respond.
- Print a heap summary for a process, a core file, or a remote debug server.
- Print a histogram (all objects or only live objects) of a process, a core file, or a remote debug server.
- Print information on objects awaiting finalization.
- Print class loader statistics of the permanent generation.
- Pass flags to the VM.
Serviceability Agent Debug Daemon, which acts as debug server.
- Attach to a Java process or a core file.
- Remote clients can attach to the server using RMI.
- Print stack traces of threads for a process, core file, or remote debug server
- Print information about concurrent locks for a process, core file, or remote debug server
- Force the stack dump for a process if the process does not respond
Scripting Tools
- Command-line script shell: Evaluate or execute a script in interactive or batch mode.
- Pass flag to the VM.
- Set Java system properties.