United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...

jvmstat FAQ

 
 
This Frequently Asked Questions list is part of the jvmstat 3.0 tools   »  Read More
  1. I downloaded and installed the jvmstat 1.0 tools, but the jvmps command doesn't list any of the running JVMs. If I run the jvmstat and visualgc tools I get an error message
  2. When I try to use the jvmstat 1.0 tools with J2SE 1.4.2, the HotSpot JVM crashes with a diagnostic message
  3. The HotSpot 1.4.2 JVM shipped as part of the J2SE 1.4.2 release. When will the jvmstat tools that are capable of monitoring this version be released?
  4. I'm running on Windows and I've installed J2SE 1.4.2 and jvmstat 2.0, but when I run jvmps it does not display any java processes. I can run 'visualgc 0' and it will work, but I cannot get visualgc or any other jvmstat tool to monitor other Java processes.
  5. Does jvmstat support J2SE 5.0?
  6. What are the new command names?
  7. Where is the explanation for the jstat output fields?
  8. How can I monitor an application which is behind a firewall?
  9. Is there any documentation in the download bundle?
  10. Are there any examples of how to use visual gc?
  11. I understand that JDK 5.0 and jvmstat 3.0 can monitor HotSpot 1.4.1, 1.4.2, and 1.5.0 JVMs, but I really, really, really, (no I mean REALLY!) cannot install JDK 5.0 on my system. Is there any way that I can download the old 1.1 or 2.0 distributions?
  12. I've installed JDK 5.0 and jvmstat 3.0 on my Windows system. I can run jps and jstat without any problems, but when I try to run visualgc I get an error?
  13. I am using a JVM that is not the Sun HotSpot JVM... can I use jvmstat?
  14. I'm running jvmstat on Windows and I can't monitor one of the Java applications?
  15. I'm getting the error "Could not attach to vmid : Could not map vmid to user Name"?
  16. I'm getting a java.lang.NoClassDefFoundError error?
  17. I get an error when trying to monitor a JDK 6 JVM with jvmstat 3.0?
1. I downloaded and installed the jvmstat 1.0 tools, but the jvmps command doesn't list any of the running JVMs. If I run the jvmstat and visualgc tools I get an error message


    Could not attach to  
            
vmid:  
            
reason
          
-XX:+UsePerfData


2. When I try to use the jvmstat 1.0 tools with J2SE 1.4.2, the HotSpot JVM crashes with a diagnostic message


    # HotSpot Virtual Machine Error, Internal Error
    # Please report this error at
    # http://java.sun.com/cgi-bin/bugreport.cgi
    #
    # Java VM: Java HotSpot(TM) Client VM (1.4.2-b28 mixed mode)
    #
    # Error ID: 504552460E435050011E
    #


3. The HotSpot 1.4.2 JVM shipped as part of the J2SE 1.4.2 release. When will the jvmstat tools that are capable of monitoring this version be released?



4. I'm running on Windows and I've installed J2SE 1.4.2 and jvmstat 2.0, but when I run jvmps it does not display any java processes. I can run 'visualgc 0' and it will work, but I cannot get visualgc or any other jvmstat tool to monitor other Java processes.




  1. Set the TMP environment variable to refer to a directory on an NTFS file system, or any file system that supports persistent access control lists. Note that this file system should be local to the machine. Setting this option for target applications is application specific. To set this variable in a command prompt or in a batch script, simply enter the following:

    set TMP= path

    The environment variable can be set globally by adding it to the list of environment variables in the System Properties (Control Panel->System, select the "Advanced" tab and click on the "Environment Variables" button). Through this interface, you can choose to set the variable for all processes run by the current user or globally as a system variable for all processes run by the system.

    The TMP variable must refer to the same location for both the monitored applications and the jvmstat tools.
  2. Changing the TMP environment variable to refer to an NTFS type file system is not always a viable option. For these cases, the HotSpot JVM provides a mechanism to bypass the the file system type check. However, using this mechanism instructs the HotSpot JVM to create the jvmstat shared memory without any access controls, allowing access to the instrumentation exported by the JVM to any user on the system.

    To bypass the file system type check, set the -XX:+PerfBypassFileSystemCheck on the java command line for both the applications you want to monitor and for the jvmstat tools. Setting this option for target applications is application specific. For the jvmstat tools, the following environment variable can be set before running any of the commands:

    set VMARGS=-XX:+PerfBypassFileSystemCheck

    For the jvmstat tools bundled with JDK 5.0, include the following option on the command line (jps command used for illustrative purposes):

    jps -J-XX:+PerfBypassFileSystemCheck

5. Does jvmstat support J2SE 5.0?



-name <names>jstat -options

6. What are the new command names?



7. Where is the explanation for the jstat output fields?

jstat - Java Virtual Machine Statistics Monitoring Tool

Tuning Garbage Collection with the 5.0 Java™ Virtual Machine

8. How can I monitor an application which is behind a firewall?

RMI FAQ

http tunnelling

9. Is there any documentation in the download bundle?


<jvmstat_install_dir>

<jvmstat_install_dir>

10. Are there any examples of how to use visualgc?

JavaOne Online


TS-2428 Using jvmstat and visualgc to Solve Memory Management Problems


  1. Go to http://java.sun.com/javaone/online
  2. Login with your JavaOne Online username and password
  3. Click on "2004 Labs now available" (in the right navigation bar)
  4. Click on the "View" link for LAB-7232 (you will get a small popup with the HTML documentation)
  5. Download the PDF version of the documentation by clicking on "javaperf.pdf"


11. I understand that JDK 5.0 and jvmstat 3.0 can monitor HotSpot 1.4.1, 1.4.2, and 1.5.0 JVMs, but I really, really, really, (no I mean REALLY!) cannot install JDK 5.0 on my system. Is there any way that I can download the old 1.1 or 2.0 distributions?



Download

Download



12. I've installed JDK 5.0 and jvmstat 3.0 on my Windows system. I can run jps and jstat without any problems, but when I try to run visualgc I get an error?

     C:\>visualgc -version
     A J2SE 5.0 or later JDK is required to run this tool.
     The java version found in the PATH is:
     java version "1.5.0_01"
     Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_01-b08)
     Java HotSpot(TM) Client VM (build 1.5.0_01-b08, mixed mode, sharing)
visualgc.cmdjps.exejps.exe
  1. set JVMSTAT_JAVA_HOME to point the JDK installation directory. The location of this directory will depend on where you told the installer to install. Assuming that the installer was told to install in c:\java, you can set this variable as follows:
                c:\> set JVMSTAT_JAVA_HOME=c:\java
    
    Make sure that this directory contains the lib\tools.jar file, as that is ultimately what the script is looking for.

  2. Change your path such that the c:\java\bin directory comes before the windows directory c:\winnt\system32. However, this change may affect other applications, so the first option is probably a better choice.


13. I am using a JVM that is not the Sun HotSpot JVM... can I use jvmstat?



14. I'm running jvmstat on Windows and I can't monitor one of the Java applications?

jstatdjstatd

jstatd
  • One is based on a utility called "NTWrapper" from http://www.duodata.de/ntwrapper/scrshots.htm
  • Another is an open source tool for running Java applications as a Windows service called 'procrun' http://jakarta.apache.org/commons/daemon/procrun.html
    In order to use procrun it is necessary to know how jstatd can be invoked from Java (ie. public static void main()'s full classname and options). The name of the jstatd main class is sun.tools.jstatd.Jstatd and it's in the tools.jar file in $JAVA_HOME/lib/tools.jar. It will be necessary to remove the "-J" prefix to any arguments that are passed to jstatd.
jstatd
    jps localhost
    jstat -gcutil <vmid>@localhost 1s
jstatd

15. I'm getting the error "Could not attach to vmid : Could not map vmid to user Name"?

setuid()

16. I'm getting a java.lang.NoClassDefFoundError error?

  H:\>visualgc 1076
  Exception in thread "main" java.lang.NoClassDefFoundError:
  sun/jvmstat/monitor/MonitorException

  1. Re-install the JDK in a location where there is no whitespace in any path components.
  2. Save the current visualgc.cmd script to visualgc.bak.
    Create a new visualgc.cmd substituting the Windows shortened directory name for the locations of the JDK and jvmstat.
    For example (your actual paths may vary):
    • If the JDK is installed in c:\Program Files\java\jdk1.5.0_2 then use c:\PROGRA~1\java\jdk1.5.0_2 instead.
    • If jvmstat is installed in c:\Program Files\jvmstat then use c:\PROGRA~1\jvmstat instead.
    The resulting visualgc.cmd would then contain the following:
    c:\PROGRA~1\java\jdk1.5.0_2\bin\java -Xbootclasspath/p:c:\PROGRA~1\java\jdk1.5.0_2\lib\tools.jar -jar c:\PROGRA~1\jvmstat\jars\visualgc.jar %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
17. I get an error when trying to monitor a JDK 6 JVM with jvmstat 3.0?

    Exception in thread "main" java.lang.NullPointerException
        at com.sun.jvmstat.tools.visualgc.MonitoredVmModel.getNativeCompileTime(MonitoredVmModel.java:459)
        at com.sun.jvmstat.tools.visualgc.GCSample.<init>(GCSample.java:185)
        at com.sun.jvmstat.tools.visualgc.VisualGC.main(VisualGC.java:128)

    visualgc -version

    Version 3.0_b04 10/12/04 - Requires J2SE/Hotspot 1.5.0 or later

    Version 3.0_b07 12/10/06 - Requires Sun Java SE 5.0 or later with the HotSpot JVM
upgrade to b07














Left Curve
Java SDKs and Tools
Right Curve
Left Curve
Java Resources
Right Curve
JavaOne Banner