Java性能检测及内存泄露检测(三)——JProfiler

jprofiler分析java应用程序性能

1、测试环境
CentOS 5.5 final(64bit) + tomcat6.20 + OpenJDK1.6.24
jprofiler_linux_6_2_2.sh
jprofiler_windows_6_2_2.exe
2、Wndows客户端安装 略
3、将jprofiler_linux_6_2_2.sh上传到服务器,假设上传到/opt/jprofiler
cd /opt/jprofiler
chmod +x *.sh
./jprofiler_linux_6_2_2.sh -c
按照提示来安装,提示都很简单,不在多说。安装路径选择 /opt/jprofiler6
注意,这里的 -c 意思是用字符方式来安装,如果机器上没有 X 则加上该参数.
4、客户端连接配置
运行 JProfiler 。第一次打开会有向导,忽略它。
选择 Session->Integration Wizard->New Remote Integratation
选择 on a remote computer Linux x86/AMD 64;next
选择 JVM Vendor:sun Vsersion:1.6.0 Model:hotspot; 64 bit JVM 前打上够;next
选择 wait for a connection from the jprofiler GUI;next
输入remote address:10.0.0.19;next
输入Remote installation directory:/opt/jprofiler6;next
输入JProfiler port:默认8849
这里会列出需要在服务器端做的配置:
Integration type: [Generic application]
Selected JVM: Sun 1.6.0 (hotspot)
Startup mode: Wait for a connection from the JProfiler GUI

(1) Please insert

-agentpath:/opt/jprofiler/bin/linux-x64/libjprofilerti.so=port=8849

into the start command of your remote application right after the java command.

A remote session named Remote application on 10.0.0.147 will be created that connects to a running instance of the remote application that is started with the modified start command.
5、服务器端配置
修改系统环境配置文件 /etc/profile ,增加
JPROFILER_HOME =/ opt / jprofiler4 / bin / linux - x86
exportLD_LIBRARY_PATH
= $LD_LIBRARY_PATH:$JPROFILER_HOME

修改TOMCAT启动文件catalina.sh,添加-agentpath:/opt/jprofiler/bin/linux-x64/libjprofilerti.so=port=8849 内容到CATALINA_OPTS中;
“-agentpath:/opt/jprofiler/bin/linux-x64/libjprofilerti.so=port=8849 ” 此内容由客户端软件生成
CATALINA_OPTS = " $CATALINA_OPTS-Xms128m-Xmx128m$JPDA_OPTS-agentpath:/opt/jprofiler/bin/linux-x64/libjprofilerti.so=port=8849 "

7、Reboot Linux and startup Tomcat using startup.sh;
The log of tomcat which is $CATALINA_HOME/logs/catalina.out will show:
JProfiler > Protocolversion 23
JProfiler
> UsingJVMTI
JProfiler
> 64 - bitlibrary
JProfiler
> Listeningonport: 8849 .
JProfiler
> Nativelibraryinitialized
JProfiler
> Waiting for aconnectionfromtheJProfilerGUI


8、启动客户端
点击jprofiler菜单 session>start center>Open Session
Available session configurations中列出了刚才配置的连接,选中使用就OK了!!

9、.当中断JProfiler连接时
The log of tomcat which is $CATALINA_HOME/logs/catalina.out will show:
JProfiler > Disconnected.Waiting for reconnection.
JProfiler
> Listeningonport: 8849 .
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值