Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/demo/management/JTop/README.txt
38829 views
JTop monitors the CPU usage of all threads in a remote application1which has remote management enabled. JTop demonstrates the use of2the java.lang.management API to obtain the CPU consumption for3each thread.45JTop is also a JConsole Plugin. See below for details.67JTop Standalone GUI8===================910JTop first establishes a connection to a JMX agent in a remote11application with a JMX service URL:12service:jmx:rmi:///jndi/rmi://<hostName>:<portNum>/jmxrmi1314where <hostName> is the hostname and <portNum> is the port number15to which the JMX agent will be connected.1617To run the demo18---------------19(1) Start the application with the JMX agent - here's an example of20how the Java2D is started2122java -Dcom.sun.management.jmxremote.port=109023-Dcom.sun.management.jmxremote.ssl=false24-Dcom.sun.management.jmxremote.authenticate=false25-jar <JDK_HOME>/demo/jfc/Java2D/Java2Demo.jar2627This instruction uses the Sun's built-in support to enable a JMX agent28with a JMX service URL as described above.29You can programmatically start a JMX agent with the RMI connector30using javax.management.remote API. See the javadoc and examples for31javax.management.remote API for details.3233(2) Run JTop on a different machine:3435java -jar <JDK_HOME>/demo/management/JTop/JTop.jar <hostname>:10903637where <hostname> is where the Java2Demo.jar runs in step (1).3839These instructions assume that this installation's version of the java40command is in your path. If it isn't, then you should either41specify the complete path to the java command or update your42PATH environment variable as described in the installation43instructions for the Java(TM) SDK.4445JTop JConsole Plugin46====================4748JTop is a JConsole Plugin which adds a "JTop" tab to JConsole.4950To run JConsole with the JTop plugin51------------------------------------52jconsole -pluginpath <JDK_HOME>/demo/management/JTop/JTop.jar535455To compile56----------57javac -classpath <JDK_HOME>/lib/jconsole.jar JTopPlugin.java5859com.sun.tools.jconsole API is in jconsole.jar which is needed60in the classpath for compilation.616263