Btrace Notes

1. 使用btrace前需要配置下环境变量.

Btrace_Path

%Btrace_Path%\bin

2. Btrace 跟visual vm 一样,不支持JDK5. 所以我维护的老项目又悲剧了.迄今为止能profiling jdk 5 的也只有jproflier.

explanation from Bachorik.

JRE 5 lacks the ability to dynamically attach to a running JVM process, load the agent and retransform classes. Additional, it requires the agent to be in form of a native library incurring rather big overhead in maintaining multiplatformness

http://kenai.com/projects/btrace/forums/forum/topics/13112-running-BTrace-on-JRE

3. 配置好JRE后,使用JPS获取需要监控的PID. JPS可以在%java_home%/bin目录下找到.

4. Btrace解压文件Sample目录下有很多sample 程序, 多半需求根据名字直接用. 比如检测method cpu,memory 的 utilization.

5. OSGI的工程需要在配置文件里面把Btrace的library include进去.

config.properties

org.osgi.framework.bootdelegation=com.sun.btrace, com.sun.btrace.*

 

一些常用的code:

 

Profiling:

Untitled 

 

Error : Port 2020 unavailable.

Step1:netstat -np TCP | find "2020"   {netstat -np <protocol> | find "port #"}

Step2:btrace –p new port …..

 

http://kenai.com/jira/browse/BTRACE-31

 

official website:
http://kenai.com/projects/btrace
download :
http://kenai.com/projects/btrace/downloads/directory/releases
Manual:
http://kenai.com/projects/btrace/pages/UserGuide

JavaDoc1.2:

http://btrace.kenai.com/javadoc/1.2/index.html

转载于:https://www.cnblogs.com/robinw/archive/2012/12/18/2823677.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值