|
This Frequently Asked Questions list is part of the jvmstat 3.0 tools
» Read More
If the error message is of the form: Could not attach to vmid: reasonThe jvmstat tools can only monitor the HotSpot 1.4.1 JVM and only when the target JVM has been started with the -XX:+UsePerfData option. Please verify that your application is running with the correct JVM and that the required -XX option is set.
2. When I try to use the jvmstat 1.0 tools with J2SE 1.4.2, the HotSpot JVM crashes with a diagnostic message If the diagnostic message is of the form:
# 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
#
The jvmstat 1.0 tools are only compatible with the HotSpot 1.4.1 JVM. Unfortunately, an interface change was required for HotSpot 1.4.2 that prevents the 1.0 tools from monitoring a HotSpot 1.4.2 JVM. The jvmstat 2.0 tools will work with the HotSpot 1.4.2 JVM. However now that the jvmstat 3.0 tools have been released and are compatible with J2SE 5.0, 1.4.2 and 1.4.1 there is no longer a need to use previous versions of jvmstat.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? The jvmstat 2.0 tools were designed to work with J2SE 1.4.2, but have now been obsoleted by jvmstat 3.0 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. The problem is most likely that your default Windows temporary directory is on a FAT type file system. For security reasons, the shared memory exported by the HotSpot JVM is disabled whenever the JVM encounters a FAT type file system (more precisely, any file system that does not support persistent access control lists) as such file systems provide insufficient access controls. There are two potential work-arounds for this issue:
5. Does jvmstat support J2SE 5.0? Yes, now jvmstat 3.0 can monitor J2SE 5.0, J2SE 1.4.2 and J2SE 1.4.1 virtual machines (effectively replacing and superseding all previous versions of jvmstat). Note some of the options for (the older) jvmstat command are no longer available with jstat. Also, many of the counters output by the old -name <names> option are no
longer available. The preferred interfaces are now the formatted output
options jstat -options. If you had scripts that relied on the availability
of certain counter names, those script may no longer work as expected. 6. What are the new command names? If you used previous versions of jvmstat you may be familiar with some of the older names... Here is a mapping of the old names to the new names:
7. Where is the explanation for the jstat output fields? Please see the documentation for jstat - Java Virtual Machine Statistics Monitoring Tool For more background information on garbage collection please see: Tuning Garbage Collection with the 5.0 Java™ Virtual Machine 8. How can I monitor an application which is behind a firewall? This is really a challenge of using RMI behind a firewall. Please see the RMI FAQ for a discussion of RMI and firewalls (specifically incoming Java RMI calls). Perhaps the easiest way is with http tunnelling 9. Is there any documentation in the download bundle? Yes... there is a README file in the directory where jvmstat is installed: <jvmstat_install_dir>/README and there is HTML documentation available at: file:///<jvmstat_install_dir>/docs/index.html 10. Are there any examples of how to use visualgc? Yes. If you attended JavaOne 2004 you received a complementary yearly subscription to JavaOne Online (otherwise anyone may use JavaOne Online for a 30 minute evaluation period). You can download the PDF for the following JavaOne 2004 Technical Session: TS-2428 Using jvmstat and visualgc to Solve Memory Management Problems You may also download the PDF for the JavaOne 2004 Hands-on Lab, LAB-7232 Java™ Technology-Based Application Performance Analysis, by following these steps:
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? Although we would prefer that users use the jvmstat tools bundled in JDK 5.0, we understand that this is not possible in all case. So, here are the links to the old downloads:
click here to download jvmstat 1.1 (209583 bytes, md5sum:
14d4aa8e0df624d10f9b2822200af646 )
click here to download jvmstat 2.0 (254284 bytes, md5sum:
0c1f2dd055a6e1888826dbb33111e532 )
However, we can offer little support for these versions. 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? If the error is like this:
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)
This is a problem with the visualgc.cmd script. The script attempts to
find the location of the JDK by locating the jps.exe binary. However,
a JDK that has been installed by the installer places jps.exe in the
windows directory. There are two ways to resolve this problem:
13. I am using a JVM that is not the Sun HotSpot JVM... can I use jvmstat? We have had a great deal of interest in jvmstat from the Java Licensees, however Sun is the only one to have implemented the jvmstat features in the JVM at this time. 14. I'm running jvmstat on Windows and I can't monitor one of the Java applications? It is essential that the jvmstat programs have the same credentials as the application they are monitoring. If that is not possible one workaround is to to have jstatd monitor the application (using the same credentials) and allow other users to connect to the local jstatd daemon to run jvmstat programs. Users have contributed the following techniques for running jstatd as a service:
jps localhost
jstat -gcutil <vmid>@localhost 1s
Make sure that the jstatd service is started with the same user credentials as
the target application.
15. I'm getting the error "Could not attach to vmid : Could not map vmid to user Name"? This error message occurs when an application makes a native call to setuid() to change the user id
associated with the process. Applications often do this because they need
to start as root in order to bind to a TCP/IP port below 1024
but then change to a non-privileged user id through
this native call. One
workaround to this problem is to configure the application to not use
a privileged port and to disable its setuid call.
Otherwise the jvmstat tools must be run with the same user
credentials as the non-privileged application user.
16. I'm getting a java.lang.NoClassDefFoundError error? If the error is like this: H:\>visualgc 1076 Exception in thread "main" java.lang.NoClassDefFoundError: sun/jvmstat/monitor/MonitorExceptionThis may be caused by one of two symptoms: first you may not have JDK 5.0 installed (a JRE or previous version will not work) or secondly there may be whitespace in the path to the JDK. In the former case please install JDK 5.0. For the latter case there are two workarounds:
If the error from visualgc is like this:
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.
Make sure that you are using visualgc 3.0 b07 or later.
To check which version of jvmstat/visualgc you are using,
run the following command:
visualgc -version
The version number is included in the output. For build 04,
you would see the following output:
Version 3.0_b04 10/12/04 - Requires J2SE/Hotspot 1.5.0 or later
For build 07, you'd see this output:
Version 3.0_b07 12/10/06 - Requires Sun Java SE 5.0 or later with the HotSpot JVM
If you are using b04, please upgrade to b07.
| |||||
|
| ||||||||||||