Java VisualVM:如何在进程启动之前初始化设置?
VisualVM 实际上是独立的 Netbeans Profiler(顺便说一句,这是一个很棒工具)。
但我缺少的是在进程启动之前初始化进程监控设置的能力。
通常,在 VistualVM 中,只有当进程已经运行时才可以打开进程并开始更改设置。当人们想要分析短期流程时,这就是一个问题。
遗憾的是,这个解决方案没有不起作用:Java 程序启动得不够“快”,并且在被 VisualVM 识别之前就被挂起这样。
是否可以采取某种方式?
注 1:我当前的解决方法:我在项目中添加了一个命令行开关:“-W”以等待 [enter]< /code> 按键。
注 2:奇怪的是,Netbeans Profiler 仍然提供了更加真实的分析结果。但它目前有一个错误,这迫使我重新编译主项目的次数是链接项目的次数;) 那将是 12...而且我未能重现该错误。
VisualVM is practically the standalone Netbeans Profiler (which is a great tool, by the way).
But what I am missing, is the ability to initialize monitoring settings for a process before it starts.
Usually, in VistualVM, one can open a process and start changing settings only when the process is already running. This is a problem when one should want to profile a shorter-term process.
Sadly, this solution doesn't work: A Java program doesn't starts "fast enough", and gets suspended before it would be recognized by VisualVM as such.
Is it possible to do somehow?
NOTE 1: My current workaround: I added a cmd-line switch to my project: "-W" to wait for an [enter]
key press.
NOTE 2: Strange, the Netbeans Profiler still gives much more realistic profiling results. But it has a bug currently, which forces me to recompile the main project the amount of times of linked projects ;) That'll be 12... And I failed to reproduce the bug.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论