本文介绍了YourKit配置文件远程Grails应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图追踪我在Grails应用程序中遇到的内存泄漏,并使用Yourkit Profiler,但遇到了问题。



我将Grails应用程序在生产服务器上的Tomcat6中运行,并解压缩YourKit分析器并运行它使用 sudo bin / yjp.sh -attach ,但是我收到错误:

  java.lang.reflect.InvocationTargetException $ b $ at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl .java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.yourkit.Main $ 2.run(a:19)
引起:com.yourkit.runtime.PresentableException:com.sun.tools.attach.AttachN otSupportedException:无法打开套接字文件:目标进程没有响应或HotSpot VM未加载
在com.yourkit.ui.sna(a:170)
在com.yourkit.ui.sna(a:176 )com.yourkit.ui.sja上的
(a:250)com.yourkit.c.do上的
(a:73)com.yourkit.Main0.entry上的
(a: 274)
... 5 more

我正在使用YourKit v10,并在Ubuntu 11.04服务器。任何想法?

解决方案

看起来我必须以运行容器的用户身份运行。将 sudo bin / yjp.sh -attach 更改为 sudo -u tomcat6 bin / yjp.sh -attach 工作。 / p>

I am trying to track down a memory leak that I am having with a Grails application and am using the Yourkit Profiler, but am running into a problem.

I have the Grails application running in Tomcat6 on the Production server and have unpacked the YourKit profiler and ran it according to the documentation using sudo bin/yjp.sh -attach, but I am getting the error:

java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.yourkit.Main$2.run(a:19)
Caused by: 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.ui.s.n.a(a:170)
    at com.yourkit.ui.s.n.a(a:176)
    at com.yourkit.ui.s.j.a(a:250)
    at com.yourkit.c.do(a:73)
    at com.yourkit.Main0.entry(a:274)
    ... 5 more

I am using YourKit v10 and am on an Ubuntu 11.04 server. Any ideas?

解决方案

It looks like I had to run as the user running the container. Changing sudo bin/yjp.sh -attach to sudo -u tomcat6 bin/yjp.sh -attach worked.

这篇关于YourKit配置文件远程Grails应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-14 13:57