VisualVM启动器错误 [英] VisualVM launcher error

查看:101
本文介绍了VisualVM启动器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Eclipse VisualVM 启动器.看起来非常不错,但是如果VisualVM太晚而无法对应用程序进行任何性能分析,则它似乎会生成一个实例.我的应用程序在初始化探查器之前就完成了执行.一旦启动,将弹出一个错误窗口,提示:无法打开请求的应用程序.然后显示运行Eclipse的VM(标记为"org.eclipse.equinox.launcher.Main").如何获得它以等待我的应用程序并进行正确的性能分析?

I'm trying to use the Eclipse VisualVM launcher. It seems pretty nice, except that it seems to spawn an instance if VisualVM too late to do any profiling of my application. My application finishes execution before the profiler is even initialized; once it starts up, an error window pops up, saying: cannot open requested application. It then shows VM running Eclipse (labeled "org.eclipse.equinox.launcher.Main"). How can I get it to wait for my application and do proper profiling?

推荐答案

我知道这个问题.我一直想出的唯一一个穷人的解决方案是:

I know that problem. The only poor man's solution I always came up with is:

  1. 在源代码中设置断点
  2. 以调试模式启动程序
  3. 连接探查器
  4. 让程序继续

VisualVM将配置文件代理注入到您的VM中只需要一点时间,我很确定它只允许远程配置.

It just takes a bit time for VisualVM to inject the profiling agent into your VM and I am pretty sure that it allows only remote profiling.

作为替代方案,您可以使用 YourKit ,它可以从一开始就对您的应用程序进行配置.通过这种方式,可以在VM启动时注入分析代理程序:

As an alternative you could use YourKit, it can profile your application from the very start. This way the profiling agent is injected on VM startup:

java -agentpath:c:\yourkit\yjpagent.dll FooClass

我很好奇VisualVM为什么不提供此选项,因为它在技术上是可行的.无论如何,除非您也对类加载等感兴趣,否则我认为调试技巧是Eclipse内部的一个很好的解决方案.

I am curious why VisualVM does not offer this option, since its technically possible. Anyway I think the debug trick is a good solution from within Eclipse, unless you are also interested in the class loading etc.

这篇关于VisualVM启动器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆