使用Yourkit分析Spray HTTP应用程序

时间:2016-05-11 14:18:27

标签: profiling spray yourkit

我在远程计算机上运行了基于Spray的HTTP应用程序,我想使用Yourkit对其进行分析。我按照Yourkit网站上提到的说明进行操作,最后我遇到了这个错误:

root@remote-worker:/home/joe/yjp-2016.02/bin# sh yjp.sh -attach 19960
Attaching to process 19960 using default options
[YourKit Java Profiler 2016.02-b36] Log file: /root/.yjp/log/yjp-23609.log
com.yourkit.runtime.PresentableException: com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: target process not responding or HotSpot VM not loaded
    at com.yourkit.f.a.a(a:93)
    at com.yourkit.f.b.attach(a:188)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.yourkit.Main$5.run(a:17)

Attach to a running JVM failed.

Solution: start JVM with the profiler agent instead of attaching it to a running JVM:
https://www.yourkit.com/docs/java/help/running_with_profiler.jsp
root@remote-worker:/home/joe/yjp-2016.02/bin# 

1 个答案:

答案 0 :(得分:1)

在消息末尾打印解决方案:使用探查器代理启动JVM,而不是将其附加到正在运行的JVM:https://www.yourkit.com/docs/java/help/running_with_profiler.jsp

Attach仅适用于HotSpot JVM;并且运行JVM进程应该具有足够的权限。请在https://www.yourkit.com/docs/java/help/attach_agent.jsp

的“附加模式限制”中找到详细信息