jdk/src/demo/share/management/VerboseGC/README.txt
author chegar
Tue, 22 Mar 2016 10:43:19 +0000
changeset 36709 f9f252088afa
parent 25859 3317bb8137f4
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
VerboseGC demonstrates the use of the java.lang.management API to 
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
print the garbage collection statistics and memory usage remotely 
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
by connecting to a JMX agent with a JMX service URL:
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
      service:jmx:rmi:///jndi/rmi://<hostName>:<portNum>/jmxrmi
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
where <hostName> is the hostname and <portNum> is the port number
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
to which the JMX agent will be connected.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
To run the VerboseGC demo
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
(1) Start the application with the JMX agent - here's an example of 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
    how the Java2D is started
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
    java -Dcom.sun.management.jmxremote.port=1090
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
         -Dcom.sun.management.jmxremote.ssl=false
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
         -Dcom.sun.management.jmxremote.authenticate=false
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
         -jar <JDK_HOME>/demo/jfc/Java2D/Java2Demo.jar
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
    This instruction uses the Sun's built-in support to enable a JMX agent.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
    You can programmatically start a JMX agent with the RMI connector
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
    using javax.management.remote API.  See the javadoc and examples for
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
    javax.management.remote API for details.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
(2) Run VerboseGC
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
   
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
      java -jar <JDK_HOME>/demo/management/VerboseGC/VerboseGC.jar localhost:1090
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
These instructions assume that this installation's version of the java
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
command is in your path.  If it isn't, then you should either
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
specify the complete path to the java command or update your
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
PATH environment variable as described in the installation
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
instructions for the Java(TM) SDK.