Jprofiler工具安装及使用

一、  下载相应版本html

      下载连接地址:http://www.ej-technologies.com/download/jprofiler/files.htmllinux

      根据自己系统的类型下载相应的版本,这里主要以windows64位系统及linux系统上的版本为例。windows

 

二、  安装服务器

      1)、客户端安装:安装好工具,启动会要求注册jvm

             下面是注册码,任意选择一个:工具

                 L-Larry_Lau@163.com#24777-1i8da63tvtyl2#1119
                 L-Larry_Lau@163.com#61624-1dvrt8wj18v1#6260
                 L-Larry_Lau@163.com#50028-se4zkrr1m6t1#10246
                 L-Larry_Lau@163.com#15600-189y158nwwvuk#339
                 L-Larry_Lau@163.com#30640-1lklqdbcjmhxs#4016
                 L-Larry_Lau@163.com#57474-53b2wr1311gnz#10228
                 L-Larry_Lau@163.com#19667-11r2awc10nqelb#4016
                 L-Larry_Lau@163.com#60353-pphob7wraf0y#515
                 L-Larry_Lau@163.com#65157-1ae6ytp7ygj8m#0012
                 L-Larry_Lau@163.com#16226-1n5h5951019s7s#7343
性能

                 注册码前面的邮箱部分为注册邮箱spa

       2)、服务器安装日志

      我这里下载的是tar.gz版本, 能够先下载在上传到服务器也能够直接在服务器上下载:orm

      命令:wget http://download.ej-technologies.com/jprofiler/jprofiler_linux_7_1_2.tar.gz

      解压:tar -xzvf jprofiler_linux_7_1_2.tar.gz

      拷贝:cp –rf jprofiler7 /usr/local/   (拷贝到安装目录)

 

      配置环境变量:

           修改/etc/profile系统配置文件:

           JPROFILER_HOME=/usr/local/jprofiler7/bin/linux-x64

           export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$JPROFILER_HOME

           使配置文件生效:source /ect/profile

 

三、  Jprofile 与resin4.0服务器启动配置

      1)  找到resin.xml文件,在<cluster>…</cluster>其中加入以下配置:

      <class-loader>

              <tree-loader path="/usr/local/jprofiler7/lib"/>

              <tree-loader path="/usr/local/jprofiler7/bin"/>

      </class-loader>

 

      <server-default>

           <jvm-arg>-agentpath:/usr/local/jprofiler7/bin/linux-x64/libjprofilerti.so=port=8849,nowait</jvm-arg>

      </server-default>

 

      也能够将jvm参数配置放到resin.properties 文件中的jvm参数配置中

 

2)  启动resin服务器

      查看jvm-channel-service.log日志若是输出以下,证实启动成功

      JProfiler> Protocol version 35

      JProfiler> Using JVMTI

      JProfiler> JVMTI version 1.1 detected.

      JProfiler> 64-bit library

      JProfiler> Listening on port: 8849.

      JProfiler> Instrumenting native methods.

      JProfiler> Can retransform classes.

      JProfiler> Can retransform any class.

      JProfiler> Native library initialized

      JProfiler> VM 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

                  …

      其余类型的服务器启动配置,有兴趣的同窗到网上搜搜,通常只须要在服务器的jvm启动参数中加入:-agentpath:/usr/local/jprofiler7/bin/linux-x64/libjprofilerti.so=port=8849,nowait该参数就能够。

 

四、  客户端jprofile监控使用

      在本地启动安装好的jprofile,若是未破解的请按照第二步来作,启动好后New Session

      

      Ok 后以下:

      

      通常选择全部项。

      

      复选框勾选,通常选择第二项, 保存上次回话的数据,方便下次数据变动比较。

      选择ok

      到此一个简单的监控会话产生了,具体的界面监控画面分析使用请网上搜索 JProfiler使用说明.pdf  该文档不是7版本的使用文档, 不过大同小异

      最后说明一点, 该工具主要是监控内存占用状况看是否有 member leak ,cpu的使用百分比, 但实际会影响应用的处理性能,且数据不会是服务器上的实时监控的数据。

相关文章
相关标签/搜索