Btrace使用
来源:互联网 发布:红色网络教育家园导航 编辑:程序博客网 时间:2024/05/02 14:39
前阵子排查一个OOM 的问题,刚好和hsf有点关系,于是找毕玄帮忙查找问题,看看hsf 的代码,看到毕玄在用Btrace来跟踪方法的调用,觉得此法还是不错滴,以前都是人肉看现象推测,汗,再次记录下。
http://blog.bluedavy.com/?p=185 这个是毕玄记录的BTrace使用,可以参考下。
BTrace is a safe, dynamic tracing tool for Java. BTrace works by dynamically (bytecode) instrumenting classes of a running Java program. BTrace inserts tracing actions into the classes of a running Java program and hotswaps the traced program classes.
BTrace 可以在不改代码、不重启应用的情况下,动态的查看程序运行细节的工具,可以蛮方便食用的。
其官方网站在此:http://kenai.com/projects/btrace/,
具体的实施操作细则可以参考:
http://kenai.com/projects/btrace/pages/UserGuide
下面是摘抄的写一个BTrace类的主意事项:
a BTrace class
- can not create new objects.
- can not create new arrays.
- can not throw exceptions.
- can not catch exceptions.
- can not make arbitrary instance or static method calls - only the public static methods of com.sun.btrace.BTraceUtils class or methods declared in the same program may be called from a BTrace program.
- (pre 1.2) can not have instance fields and methods. Only static public void returning methods are allowed for a BTrace class. And all fields have to be static.
- can not assign to static or instance fields of target program's classes and objects. But, BTrace class can assign to it's own static fields ("trace state" can be mutated).
- can not have outer, inner, nested or local classes.
- can not have synchronized blocks or synchronized methods.
- can not have loops (for, while, do..while)
- can not extend arbitrary class (super class has to be java.lang.Object)
- can not implement interfaces.
- can not contains assert statements.
- can not use class literals.
- Btrace使用
- BTrace使用
- btrace使用
- btrace使用
- btrace使用
- BTrace使用
- (转)btrace使用
- BTrace使用简介
- btrace使用简介
- BTrace 工具使用
- BTrace使用简介
- BTrace使用简介
- BTrace使用简介
- BTrace使用总结
- BTrace使用总结
- btrace 的使用
- BTrace使用总结
- BTrace使用简介
- STM32入门经历,高手不要进!
- 一篇通俗的objective-c入门
- 大家好,我是新来的
- (参考)ubuntu shell脚本开机自动运行的方法
- Ext.grid.EditorGridPanel使用方法
- Btrace使用
- JAVA调用存储过程--传入集合参数
- 求 基于jsp+access的网上书店 毕业设计+毕业论文
- 连接 Derby数据库
- 开窗函数
- Attribute在.NET编程中的应用(三)
- 两分钟彻底让你明白Android Activity生命周期(图文)
- xml excel
- RMAN failed becaue of ORA-19502.