Jprofiler
时间:2009-03-27 来源:peacock66
一、 环境:
本地客户端 winXP
远端服务器 centos5 apache2 tomcat6 jdk1.6
二、 下载:
下载 linux服务端
http://www.brothersoft.com/jprofiler-for-liunx-download-188514.html
下载windows客户端
http://www.brothersoft.com/jprofiler-download-81861.html
三、 客户端安装
默认安装,
有一个页面要注意。
四、 服务端安装
. /jprofiler_linux_5_1_4.sh –c
由于没有图形界面,使用 “-c ”参数安装。
五、 服务端配置:
1) vi catalina.sh
添加“-agentlib:jprofilerti=port=8849 -Xbootclasspath/a:/opt/jprofiler5/bin/agent.jar”
到 JAVA_OPTS= “”
2) vi /etc/profile
JPROFILER_HOME=/opt/jprofiler5
export LD_LIBRARY_PATH=$JPROFILER_HOME/bin/linux-x86
保存退出。
3) 执行source /etc/profile
六、客户端安装过程中需要注册:
注册码在网上查找
七、 启动tomcat
1) 检查日志
JProfiler> Protocol version 25
JProfiler> Using JVMTI
JProfiler> JVMTI version 1.1 detected.
JProfiler> 32-bit library
JProfiler> Listening on port: 8849.
JProfiler> Instrumenting native methods.
JProfiler> Native library initialized
JProfiler> Waiting for a connection from the JProfiler GUI ...
程序处于等待状态
2) 执行客户端
日志显示:
Mar 26, 2009 1:10:29 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8444
Mar 26, 2009 1:10:29 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 12350 ms
JProfiler> Protocol version 25
JProfiler> Using JVMTI
JProfiler> JVMTI version 1.1 detected.
JProfiler> 32-bit library
JProfiler> Listening on port: 8849.
JProfiler> Instrumenting native methods.
JProfiler> Native library initialized
JProfiler> Waiting for a connection from the JProfiler GUI ...
JProfiler> Using dynamic instrumentation
JProfiler> Time measurement: elapsed time
JProfiler> CPU profiling enabled
JProfiler> Hotspot compiler enabled
JProfiler> Starting org/apache/catalina/startup/Bootstrap ...
3) 当断掉连接后日志如下:
Mar 26, 2009 1:56:34 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8444
Mar 26, 2009 1:56:34 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 35479 ms
JProfiler> Disconnected. Waiting for reconnection.
JProfiler> Listening on port: 8849.