限制 Visual VM 中的分析

发布于 2024-07-17 15:26:44 字数 187 浏览 3 评论 0原文

我正在尝试新 JDK 附带的 VisualVM 程序。 我正在对其进行分析,并尝试仅对特定包中的方法进行 CPU 分析。

我将以下内容放入“仅配置文件类:”中,

jig.*

其中 jig 是我想要检测的包。 不幸的是,我得到了不在该包或任何子包中的其他方法的结果。

I am trying out the VisualVM program that comes with the new JDKs. I am doing profiling on it and trying to profile CPU on only methods in a particular package.

I put the following in the "Profile Only Classes:"

jig.*

Where jig is the package I want to instrument. Unfortunately I get back results on other methods that are not in that package or any subpackages.

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

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

发布评论

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

评论(3

时光暖心i 2024-07-24 15:26:45

您可以在“分析结果”列表底部的文本字段中输入过滤条件,这应该可以解决问题。

You can enter a filtering criterion in the text field at the bottom of the "Profiling Results" list, that should do the trick.

当爱已成负担 2024-07-24 15:26:44

我可以重现您的问题的唯一方法是选中“配置新的可运行对象”框。 当我选中该选项时,探查器会拾取作为新线程启动的代码,即使该代码不符合过滤条件。 我想这是不清楚的功能。

您应该确保在进行分析活动之前取消选中该框。 请注意,如果未选中它,这可能意味着您将看不到您自己的任何恰好作为单独线程启动的代码的配置文件信息。 (但我认为你很可能没有这样做,所以你没有什么可担心的。)

The only way I can reproduce your problem is if I leave the "Profile new Runnables" box checked. When I leave that checked, the profiler picks up code started as new threads, even if that code does not meet the filtering criteria. I guess this is unclear functionality.

You should make sure you uncheck that box before you do your profiling activity. Just be aware that with it unchecked, that probably means you won't see profile information of any of your own code that happens to be started as a separate Thread. (But I figure there's a good chance you're not doing that, so you have nothing to be concerned about.)

鹿港小镇 2024-07-24 15:26:44

实际上有一个关于此的开放错误:

https://java.net/jira/browse/VISUALVM-546

我完全同意提交者的观点(以及你对 VisualVM 的“奇怪”行为感到失望)。 在我看来,即使选中了“Profile new Runnables”,过滤器也必须得到尊重。

分析它是一项重要的任务,特别是对于通常部署在应用程序服务器上的大型项目,其中常见的方式(也是正确的方式)具有用于后台任务和服务用户请求的线程。

我邀请大家投票支持 VisualVM 开发人员的关注。

Actually there's an opened bug about that:

https://java.net/jira/browse/VISUALVM-546

I totally agree with the submitter (and with your disappointing about the "strange" behavior of VisualVM). Even with "Profile new Runnables" checked the filter must be honored in my opinion.

Profiling it's an important task to do especially with large project typically deployed on application-server where it's the common-way (and the right-way) have threads for background tasks and to serve user requests.

I invite everybody to vote for give attention from the VisualVM developers.

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