寻找端到端 Java CPU 分析器的建议

发布于 2024-07-10 10:42:54 字数 1560 浏览 5 评论 0原文

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

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

发布评论

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

评论(4

两人的回忆 2024-07-17 10:42:54

到目前为止,我最喜欢的是 JProfiler。 直到现在我才意识到这一点(因为我总是使用交互式分析 GUI),但它实际上支持离线分析,正如您所描述的那样。

其他一些很酷的功能:

  • 它会分析您的所有 SQL 语句,以便您可以了解哪些数据库查询正在减慢您的速度。

  • 它跟踪哪些方法(其中的类和包)分配了最多的内存,哪些类型的对象和包分配了最多的内存。 数组,以及这些对象的寿命。 因此,如果发生内存泄漏,可以很容易地追踪哪些类型的类实例已经过时,并找到最初分配这些对象的方法(以及谁持有使对象保持活动状态的引用)。< /p>

  • 您可以跟踪 VM 的增长,监控 GC 完整收集的频率,并确定每个收集周期期间释放了多少对象(哪种类型)。

  • 当然,您还可以获得所有方法调用的层次结构细分,以及整个调用堆栈的调用次数和平均执行时间(不包括或包括)。 您还可以从“最差瓶颈”函数的角度查看此层次结构,按执行时间或内存分配排序。

对我来说,JProfiler 是我开发过程中最重要的工具之一(仅次于 Eclipse)。


另外:还有10 天免费试用。 下载并查看。 而且,顺便说一句,我不隶属于该公司或任何其他机构。 在过去的五六年里,我一直是一个满意的客户。

My favorite, by far, is JProfiler. I didn't realize it until just now (because I always use the interactive profiling GUI), but it does in fact support offline profiling, exactly like you described.

A few other cool features:

  • It profiles all your SQL statements, so you can see which DB queries are slowing you down.

  • It keeps track of which methods (in which classes & packages) are allocating the most memory, for which types of objects & arrays, and the longevity of those objects. So, if you're leaking memory, it's easy to track down which types of class instances are outliving their usefullness, and to find the methods where those objects were originally allocated (and who's holding the references that are keeping the objects alive).

  • You can keep track of the VM growth, monitoring the frequency of GC full collections, and determining how many objects (of which type) were freed during each collection cycle.

  • And of course, you get a hierarchical breakdown of all method invocations, with the number of calls and mean execution time (exclusive or inclusive) of the whole call stack. You can also view this hierarchy from the perspective of "worst bottleneck" functions, ordered either by execution time or memory allocation.

For me, JProfiler is one of the most important tools in my development process (second only to Eclipse).


Also: there's a free 10-day trial. Download it and check it out. And, btw, I'm not affiliated with the company or anything. I've just been a happy customer for the last five or six years.

暮年慕年 2024-07-17 10:42:54

我对离线分析不熟悉。 这不是 hprof 的用途吗? 除此之外,我在 YourKit profiler 方面获得了非常好的体验。

I am not familiar with offline profiling. Isn't it what hprof is for?. Otherwise I've had very good experience with YourKit profiler.

雨落星ぅ辰 2024-07-17 10:42:54

我对 NetBeans Profiler 非常满意; 我相信它也能满足您的所有要求。

I've been very happy with NetBeans Profiler; I believe it also satisfies all your requirements.

猫性小仙女 2024-07-17 10:42:54

您可以尝试 JRockit Mission Control 附带的运行时分析器。 它会生成录制文件,您稍后可以在 GUI 中打开这些文件。 开销非常低,通常低于1-2%,而且非常容易使用。

您可以从命令行开始录制,如下所示:

JROCKIT_HOME\bin>java -XXjra:recordingtime=2000s,filename=myrecording.jra,sampletime=1

并且如果 JVM 退出,在记录完成之前,分析数据将刷新到光盘。

You could try the runtime analyzer that comes with JRockit Mission Control. It produces recording files that you can open up in the GUI later on. The overhead is very low, usually less than 1-2%, and it's very easy to use.

You can start a recording from the command line like this:

JROCKIT_HOME\bin>java -XXjra:recordingtime=2000s,filename=myrecording.jra,sampletime=1

and if the JVM exits, before the recording has finished, the profiling data will be flushed to disc.

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