A simple usecase (Java2DDemo) of jvmstat3.0 (jps / jstat / visualgc)

jvmstat 3.0 can monitor J2SE 5.0, J2SE 1.4.2 and J2SE 1.4.1 virtual machines,
jvmstat3.0 need JDK5.0 installed, for those cannot upgrade to JDK5.0, pls find the previous version in:
1.1:
Reference [3]
2.0:
Reference [4]
Actually you can find them in the jvmstat FAQ point 11.

1: Install and setup
For installation and setup problem pls refer to reference [1], the installation part.

2: Simple test
a) Test in local
For local test, here choose the Java2DDemo to demonstrate the usage of jps / jstat / visualgc

After the installation finished,
<1> Start the Java2DDemo swing java application
C: \> java-jar "C: \ Program Files \ Java \ jdk1.5.0_06 \ demo \ jfc \ Java2D \ Java2Demo.jar
<2> use jps to find the PID of the Java2DDemo, or you can find the PID in windows task manager.
C: \> jps
5964 Program
5596 Jps
there is always has the Jps process. here the 5964 is PID of the Java2DMemo java application
<3> get the GC status by jstat and pipeline to a file to PID 5964, with 1000ms intervals and 1000 times.
C: \> jstat-gcutil 5964 1000 1000>> c: \ gc.log
for the usage of jstat you can get help by jstat-help and jstat-options

<4> Visual monitor the GC with visualgc
C: \> visualgc 5964
You will see the UI ref <VisualGC PID output> below.

b) Test for remote

3: Problems
For any problems you can refers to [2] FAQ. Actually most of the problems can find the workaround there.

References:
[1] http://java.sun.com/performance/jvmstat
[2] http://java.sun.com/performance/jvmstat/faq.html
[3] https: / / cds.sun.com / is-bin / INTERSHOP.enfinity / WFS / CDS-CDS_Developer-Site / en_US /-/ USD / ViewProductDetail-Start? ProductRef = JVMSTAT-1.0-GF @ CDS-CDS_Developer
[4] https: / / cds.sun.com / is-bin / INTERSHOP.enfinity / WFS / CDS-CDS_Developer-Site / en_US /-/ USD / ViewProductDetail-Start? ProductRef = JVMSTAT-2.0-GF @ CDS-CDS_Developer

VisualGC PID output:
A simple usecase (Java2DDemo) of jvmstat3.0 (jps / jstat / visualgc)

jstat-gcutil 5964 1000 10 output:
A simple usecase (Java2DDemo) of jvmstat3.0 (jps / jstat / visualgc)

分类:Java 时间:2010-05-24 人气:201
分享到:
blog comments powered by Disqus

相关文章

iOS 开发

Android 开发

Python 开发

JAVA 开发

开发语言

PHP 开发

Ruby 开发

搜索

前端开发

数据库

开发工具

开放平台

Javascript 开发

.NET 开发

云计算

服务器

Copyright (C) codeweblog.com, All Rights Reserved.

CodeWeblog.com 版权所有 黔ICP备15002463号-1

processed in 0.351 (s). 14 q(s)