0N/AFullThreadDump demonstrates the use of the java.lang.management API
0N/Ato print the full thread dump. JDK 6 defines a new API to dump
0N/Athe information about monitors and java.util.concurrent ownable
0N/Asynchronizers.
0N/A
0N/AThis demo also illustrates how to monitor JDK 5 and JDK 6 VMs with
0N/Atwo versions of APIs.
0N/A
0N/AIt contains two parts:
0N/Aa) Local monitoring within the application
0N/Ab) Remote monitoring by connecting to a JMX agent with a JMX service URL:
0N/A service:jmx:rmi:///jndi/rmi://<hostName>:<portNum>/jmxrmi
0N/A where <hostName> is the hostname and <portNum> is the port number
0N/A to which the JMX agent will be connected.
0N/A
0N/ATo run the demo
0N/A---------------
0N/Aa) Local Monitoring
0N/A
0N/A java -cp <JDK_HOME>/demo/management/FullThreadDump/FullThreadDump.jar Deadlock
0N/A
0N/A This will dump the stack trace and then detect deadlocks locally
0N/A within the application.
0N/A
0N/Ab) Remote Monitoring
0N/A
0N/A (1) Start the Deadlock application (or any other application)
0N/A with the JMX agent as follows:
0N/A
0N/A java -Dcom.sun.management.jmxremote.port=1090
0N/A -Dcom.sun.management.jmxremote.ssl=false
0N/A -Dcom.sun.management.jmxremote.authenticate=false
0N/A -cp <JDK_HOME>/demo/management/FullThreadDump/FullThreadDump.jar
0N/A Deadlock
0N/A
0N/A This instruction uses the Sun's built-in support to enable a JMX agent.
0N/A You can programmatically start a JMX agent with the RMI connector
0N/A using javax.management.remote API. See the javadoc and examples for
0N/A javax.management.remote API for details.
0N/A
0N/A (2) Run FullThreadDump
0N/A
0N/A java -jar <JDK_HOME>/demo/management/FullThreadDump/FullThreadDump.jar \
0N/A localhost:1090
0N/A
0N/A This will dump the stack trace and then print out the deadlocked threads.
0N/A
0N/AThese instructions assume that this installation's version of the java
0N/Acommand is in your path. If it isn't, then you should either
0N/Aspecify the complete path to the java command or update your
0N/APATH environment variable as described in the installation
0N/Ainstructions for the Java(TM) SDK.