jprofiler 远程监控aix的jvm

来源:互联网 发布:五大流氓国笑话知乎 编辑:程序博客网 时间:2024/04/26 02:09

Jprofiler在aix上安装和使用

      最近项目中出现一个内存溢出现象,经过代码走查,对一部分代码进行修改,问题仍然存在,定位了好长时间仍然没有定位出来,于是从网上查询资料,看到了jprofiler能实时监控jvm使用情况,于是将jprofiler在项目中安装和配置过程记录下来分享给大家,希望对有需要的同行们有帮助。

一 、环境介绍

       服务端

操作系统:AIX 5.3  

JDK版本:IBM JDK 1.4.2

   应用服务器:Weblogic 8.1

   Jprofiler版本:jprofiler_unix_5_2_4.sh

       客户端:

操作系统 windows XP

Jprofiler版本:jprofiler_windows_5_2_4

二、客户端Jprofiler安装以及配置

      破解

1、解压jprofiler_windows_5_2_4.zip

2、将keygen/jprofiler/windowss下的jprofiler.dll和jprofilerti.dll文件覆盖/ jprofiler_windows_5_2_4/jprofiler5/bin/windows下的对应两个文件

3、在运行cmd到通过命令行窗口执行java Keygen获取key值(例如:d:/keygen/Keygen.calss)

      安装

1、解压完成后,在/ jprofiler_windows_5_2_4/jprofiler5/bin/找到jprofiler.exe双击打开

2、根据提示选择相应信息

3、输入key值,然后一直next直到完成

       配置

1、 选择cancel

2、 选择:Session->Integration Wizards->New Server Integration

3、 选择应用服务器Weblogic 8.1 Server 点击next

4、 选择远程服务器操作系统类型AIX 点击next

5、 选择第二项Startup immediately,connect late…… 点击next

6、 输入远程服务器IP地址 点击next

7、 输入远程服务器jprofiler的安装目录 点击next

8、 输入远程服务器上的配置文件config.xml的目录

9、 选择从服务器中复制到本地的应用服务器启动文件,例如:startWeblogic.sh

10、      选择JDK类型以及版本,如果是64位,请选择64位

11、      选择默认端口8849(注意:请先开通8849端口保证通信正常)

12、      完成安装后,选择暂时不启动,稍后启动方式,点击finish

三、服务器端jprofiler安装和配置

       安装

1、  将客户端下载的jprofiler_unix_5_2_4.sh上传到服务器

2、  在jprofiler_unix_5_2_4.sh的当前目录下执行如下命令

[bea@sddwh1 /bea/opt]$./jprofiler_unix_5_2_4.sh –c

3、  执行上面命令后,提示如下

    Starting Installer ...

This will install JProfiler on your computer.

OK [o, Enter], Cancel [c]

4、  按照提示信息安装即可,

5、  修改环境变量, 在.profile文件中添加如下:

export LD_LIBRARY_PATH=/bea/jprofiler5/bin/aix-ppc  ---对应的操作系统路径

export INSTALL4J_JAVA_HOME=/jdk1.4.2/jre    --实际用到的jdk目录

6、在客户端复制一份config.xml文件,并修改里面的key为<licenseKey name="any"company="git" key="L-Larry_Lau@163.com#83851-1vyctfjv8d6ua#255"/>

7、检查生成的startWeblogic_jprofiler.sh文件中配置是否正确

8、通过上两步修改和检查正确后,将修改后的config.xml上传到服务器上对应的配置文件目录下面,将startWeblogic_jprofiler.sh复制到对应weblogic启动文件夹下面与startWeblogic.sh在同一目录下

四、启动监控和监控

1、在服务器端启动(执行startWeblogic_jprofiler.sh)出现如下内容

JProfiler> Protocol version 27

JProfiler> Using JVMPI

JProfiler> 32-bit library

JProfiler> Don't wait for frontend to connect.

JProfiler> Using config file /bea/jprofiler5/config/config.xml(id: 108)

JProfiler> Listening on port: 8849.

JProfiler> Native library initialized

JProfiler> If output stops here, please remove -Xdebug from thecommand line

Warning: JIT compiler "none" not found. Will useinterpreter.

JProfiler> Using dynamic instrumentation

JProfiler> Time measurement: elapsed time

JProfiler> CPU profiling enabled

JProfiler> Starting weblogic/Server ...

 

JProfiler> Reconnection. Using last settings.

表示jprofiler服务端启动成功

   2、在客户端执行session->start center下启动要监控的远程服务器对应的session