Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openjdk-multiarch-jdk8u
Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/demo/management/JTop/README.txt
38829 views
1
JTop monitors the CPU usage of all threads in a remote application
2
which has remote management enabled. JTop demonstrates the use of
3
the java.lang.management API to obtain the CPU consumption for
4
each thread.
5
6
JTop is also a JConsole Plugin. See below for details.
7
8
JTop Standalone GUI
9
===================
10
11
JTop first establishes a connection to a JMX agent in a remote
12
application with a JMX service URL:
13
service:jmx:rmi:///jndi/rmi://<hostName>:<portNum>/jmxrmi
14
15
where <hostName> is the hostname and <portNum> is the port number
16
to which the JMX agent will be connected.
17
18
To run the demo
19
---------------
20
(1) Start the application with the JMX agent - here's an example of
21
how the Java2D is started
22
23
java -Dcom.sun.management.jmxremote.port=1090
24
-Dcom.sun.management.jmxremote.ssl=false
25
-Dcom.sun.management.jmxremote.authenticate=false
26
-jar <JDK_HOME>/demo/jfc/Java2D/Java2Demo.jar
27
28
This instruction uses the Sun's built-in support to enable a JMX agent
29
with a JMX service URL as described above.
30
You can programmatically start a JMX agent with the RMI connector
31
using javax.management.remote API. See the javadoc and examples for
32
javax.management.remote API for details.
33
34
(2) Run JTop on a different machine:
35
36
java -jar <JDK_HOME>/demo/management/JTop/JTop.jar <hostname>:1090
37
38
where <hostname> is where the Java2Demo.jar runs in step (1).
39
40
These instructions assume that this installation's version of the java
41
command is in your path. If it isn't, then you should either
42
specify the complete path to the java command or update your
43
PATH environment variable as described in the installation
44
instructions for the Java(TM) SDK.
45
46
JTop JConsole Plugin
47
====================
48
49
JTop is a JConsole Plugin which adds a "JTop" tab to JConsole.
50
51
To run JConsole with the JTop plugin
52
------------------------------------
53
jconsole -pluginpath <JDK_HOME>/demo/management/JTop/JTop.jar
54
55
56
To compile
57
----------
58
javac -classpath <JDK_HOME>/lib/jconsole.jar JTopPlugin.java
59
60
com.sun.tools.jconsole API is in jconsole.jar which is needed
61
in the classpath for compilation.
62
63