在 Java VisualVM 中将默认配置文件 CPU 设置为 true

发布于 2024-07-22 05:55:41 字数 112 浏览 2 评论 0原文

我想使用 Java VisualVM 来分析应用程序,即使它正在启动。 默认情况下,它设置为 false。

有什么方法可以更改默认启用的分析吗?

谢谢, 阿卡什

I want to use Java VisualVM to also profile the application even when it is starting. By default, it is set as false.

Is there any way to change the profiling to be enabled by default?

Thanks,
Aakash

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

旧城空念 2024-07-29 05:55:41

VisualVM 不支持这种用法。 它用于监视已经运行的 java 应用程序。

如果您需要分析应用程序启动,则应使用 NetBeans Profiler。 NetBeans Profiler 和 VisualVM 共享相同的分析引擎,因此您可以稍后在 VisualVM 中打开和分析分析快照。

VisualVM does not support this kind of usage. It is used to monitor already running java applications.

If you need to profile the application startup you should use NetBeans Profiler isntead. NetBeans Profiler and VisualVM share the same profiling engine so you can open and analyze the profiling snapshots in VisualVM later on.

红ご颜醉 2024-07-29 05:55:41

今天,我出于自己的目的一直在使用 VisualVM,但不幸的是,似乎没有任何方法可以做到这一点。 您可以在 main 的开头放置 Thread.sleep(15000) 以获得 15 秒的时间来连接到应用程序并开始分析。

I've been playing around a lot with VisualVM today for my own purposes and there doesn't seem to be any way of doing that, unfortunately. You could probably put a Thread.sleep(15000) at the start of your main to get 15 seconds in which to connect to the application and start the profiling.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文