jprofiler安装和使用指南

=======================

Author: shiqi.cui <cuberub@gmail.com>
Date: 2009/04/17 23:52:08


This document will tell you how to install jprofiler and debug JAVA programs on local or remote machine

安装
~~~~

准备安装文件
============
   - Windows平台:jprofiler_windows_5_2_1。jprofiler是商业程序,试用版只能使用10天,继续使用需要付费。
   - 如果需要调试Linux服务器上的程序的话,还需要jprofiler_linux_5_2_1

安装
====
  - Windows端
     - 运行jprofiler_windows_5_2_1的安装文件
  - Linux端
     - 安装jprofiler_linux_5_2_1

使用
~~~~

配置
====
     - 第一次运行jprofiler,进行配置
       -- 选择JVM版本。jprofiler会自动搜索本机安装的所有JVM版本。
       -- 如果需要跟Eclipse集成的话,选择Eclipse版本号。
       -- 如果需要调试Linux服务器上的程序,配置Remote Machine的IP地址和jprofiler_linux_5_2_1的安装路径
       -- 配置文件config.xml,可以手工更新,也可以自动更新。建议选择自动更新。

调试本地程序
============
   - 运行Windows客户端
   - 设置JVM参数、Class path、Main class和Arguments等,执行
   - 在Memory Views视图,可以查看类的实例个数以及占用的内存
   - 在CPU Views视图,可以查看各个模块占用CPU时间比例
   - 在VM Telemetry Views视图,可以查看内存、垃圾回收、线程状况、CPU负载等信息

调试远程程序
============
   - 设置变量: export LD_LIBRARY_PATH=$jprofiler5/bin/linux-x64
   - 添加命令行参数-agentlib:jprofilerti=port=8849  -Xbootclasspath/a:$jprofiler5/bin/agent.jar
   - 执行程序
   - 运行Windows端程序

常见错误分析
============
   - jprofilerti库找不到:往往是采用的库的位数和JDK版本不匹配

posted on 2012-04-02 00:08  cuberub  阅读(807)  评论(0编辑  收藏  举报

导航