我有一个特别复杂的 Hadoop 代码库,其中有很多我正在查看的反射。
有没有办法打印、调试或观察 java 进程中调用的每个监视器?
或者理想情况下,在机器上运行的所有进程中......
最佳答案
我认为BTrace是一个很好的工具,可以用来在 Java 中进行跟踪
BTrace is a safe, dynamic tracing tool for the Java platform. BTrace can be used to dynamically trace a running Java program (similar to DTrace for OpenSolaris applications and OS). BTrace dynamically instruments the classes of the target application to inject tracing code ("bytecode tracing"). Tracing code is expressed in Java programming language.
关于java - 监控每个被调用的方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20022010/