限制 Visual VM 中的分析 [英] Limiting Profiling in Visual VM

查看:54
本文介绍了限制 Visual VM 中的分析的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.*

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.

推荐答案

我可以重现您的问题的唯一方法是选中Profile new Runnables"框.当我保持选中状态时,探查器会选择作为新线程启动的代码,即使该代码不符合过滤条件.我想这是功能不明确.

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.)

这篇关于限制 Visual VM 中的分析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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