Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/demo/management/VerboseGC/README.txt
38829 views
VerboseGC demonstrates the use of the java.lang.management API to1print the garbage collection statistics and memory usage remotely2by connecting to a JMX agent with a JMX service URL:3service:jmx:rmi:///jndi/rmi://<hostName>:<portNum>/jmxrmi4where <hostName> is the hostname and <portNum> is the port number5to which the JMX agent will be connected.67To run the VerboseGC demo89(1) Start the application with the JMX agent - here's an example of10how the Java2D is started1112java -Dcom.sun.management.jmxremote.port=109013-Dcom.sun.management.jmxremote.ssl=false14-Dcom.sun.management.jmxremote.authenticate=false15-jar <JDK_HOME>/demo/jfc/Java2D/Java2Demo.jar1617This instruction uses the Sun's built-in support to enable a JMX agent.18You can programmatically start a JMX agent with the RMI connector19using javax.management.remote API. See the javadoc and examples for20javax.management.remote API for details.2122(2) Run VerboseGC2324java -jar <JDK_HOME>/demo/management/VerboseGC/VerboseGC.jar localhost:10902526These instructions assume that this installation's version of the java27command is in your path. If it isn't, then you should either28specify the complete path to the java command or update your29PATH environment variable as described in the installation30instructions for the Java(TM) SDK.313233