Dar*_*zer 3 java connection profiling yourkit
我在Java中构建了一个命令行工具,我现在想用YourKit进行分析.我启动命令行工具,例如:
$ java -classpath .:foo.bar.jar com.foobar.tools.TheTool arg1 arg2 arg3
Run Code Online (Sandbox Code Playgroud)
它在不到2秒的时间内完成.
在阅读http://www.yourkit.com/docs/80/help/agent.jsp后,我尝试了以下内容:
$ java -agentpath:/home/dspitzer/yjp-8.0.24/bin/linux-x86-32/libyjpagent.so -classpath .:foo.bar.jar com.foobar.tools.TheTool arg1 arg2 arg3
Run Code Online (Sandbox Code Playgroud)
......我得到:
[YourKit Java Profiler 8.0.24] JVMTI version 3001016d; 14.3-b01; Sun Microsystems Inc.; mixed mode, sharing; Linux; 32-bit JVM
[YourKit Java Profiler 8.0.24] Profiler agent is listening on port 10001...
[YourKit Java Profiler 8.0.24] *** HINT ***: To get profiling results, connect to the application from the profiler UI
...
Run Code Online (Sandbox Code Playgroud)
(然后工具运行完成并退出.)
我猜(默认情况下,至少)YourKit旨在只连接到正在运行的应用程序.
我应该如何修改命令行工具以允许从YourKit连接?
小智 5
在探查器"连接"之前,无法暂停已分析的应用程序; 你根本不需要这样做.
相反,请执行以下操作:
从启动开启所需的分析模式.例如,如果需要分析CPU使用情况,请启动CPU采样或CPU跟踪,并使用相应的启动选项"采样"或"跟踪".请参阅http://www.yourkit.com/docs/80/help/additional_agent_options.jsp
如果配置文件应用程序短时运行,请在退出时使用"onexit = snapshot"启动选项启用快照捕获.稍后在Profiler UI中打开捕获的快照以进行分析.
| 归档时间: |
|
| 查看次数: |
6071 次 |
| 最近记录: |