与免费的 Java 分析器(例如 Netbeans 中的分析器)相比,商业 Java 分析器有哪些优势?
有时我必须对 Java 代码进行一些分析工作,我想知道为什么我应该让我的老板使用商业分析器进行调查,而不是只使用 Netbeans 或 JConsole 中的分析器?
值得投资的杀手级功能是什么?
Occasionally I have to do some profiling work on Java code, and I would like to know why I should have my boss investigate in a commercial profiler as opposed to just use the one in Netbeans or JConsole?
What would the killer features be that would warrant the investment?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
根据我使用 JProfiler 的经验,它是比 NetBeans 分析器更全面的体验。 它更容易上手,更容易解释信息,而且虽然我没有测量过,但似乎 JProfiler 对所分析的应用程序的性能产生的负面影响较小。
此外,JProfiler 与 IntelliJ IDEA 很好地集成。 我必须使用 NetBeans 来使用 NetBeans 分析器,这很不方便,因为我必须手动配置一个自由格式的项目以匹配我的项目的布局。
NetBeans 分析器可用。 与 IntelliJ 不同,我不会为我的个人项目购买 JProfiler 许可证,因为与 IDE 不同,它不是您每天都使用的工具。 然而,对于有偿工作,没有理由不购买更好的工具。 与开发人员的时间成本相比,它并不昂贵。
In my experience with JProfiler, it's just an all-round slicker experience than the NetBeans profiler. It's easier to get started, easier to interpret the information and, although I haven't measured it, it seems that JProfiler has less of a negative impact on the performance of the application being profiled.
Also, JProfiler integrates nicely with IntelliJ IDEA. I have to use NetBeans to use the NetBeans profiler, which is an inconvenience because I have to manually configure a free-form project to match the layout of my project.
The NetBeans profiler is usable. Unlike IntelliJ, I wouldn't buy a JProfiler licence for my personal projects because, unlike an IDE, it's not a tool you use all day every day. However, for paid work there's no reason not to buy a better tool. It's not expensive compared to the cost of a developer's time.
我有使用 NetBeans Profiler 和 JProbe 的经验。 对于性能分析,我发现 Netbeans 非常有用,但 JProbe 的优势在于内存分析。
JProbe 拥有出色的工具来比较堆快照并查找内存泄漏的根本原因。 例如,在 JProbe 中,您可以以图形方式直观地查看堆快照,选择要调查的节点,然后删除引用以查看该实例是否可以被垃圾收集。
I have experience using both NetBeans profiler and JProbe. For performance profiling I have found Netbeans quite useful but where JProbe is superior is for memory profiling.
JProbe has superior tools for comparing heap snapshots and finding the root cause of a memory leak. For example, in JProbe you can view heap shapshots visually as a graph, select nodes to investigate and then delete references to see if the instance could then be garbage collected.
如果您已经在使用 Netbeans,那么启动探查器就很容易了(除非您使用的是基于 Maven 的项目……唉)。
我使用过付费分析器以及 Netbeans 分析器。 Netbeans 做得足够好(刚推出时有点粗糙……但现在好多了)。
我分析的代码并不大,所以我不能说花在分析上的时间是否是一个主要因素。
答案非常主观,完全取决于您的需求。 需要注意的事项:
1) 在您的环境中的易用性(对于 NetBeans,内置分析器可能是最简单的。2
)启动 prfiler 到实际获得可用结果所花费的时间
3)它是否是一个采样或跟踪分析器? (概述如下:http://docs.hp.com/en/ 5992-0757/ch05s01.html
4) 您可以实时查看结果还是必须等待分析完成?
以下是关于 Java 分析器的 slimdot 讨论的链接:http: //ask.slashdot.org/article.pl?sid=06/06/30/0053237
If you are using Netbeans already then starting up the profiler is easy (unless you are using a Maven based project... sigh).
I have used paid profilers as well as the Netbeans one. Netbeans does the job well enough (it was a bit rough when it first came out... but much better now).
The code I profile isn't HUGE so I cannot say if the time spent in profiling is a major factor.
The answer is highly subjective and totally depends on your needs. Things to look at:
1) ease of use in your environment (in the case of NetBeans it is likely that the built in profiler is easiest.
2) time spent starting the prfiler to it actually getting you usable results
3) is it a sampling or tracing profiler? (An overview is here: http://docs.hp.com/en/5992-0757/ch05s01.html
4) can you view the results live or do you have to wait for the profiling to finish?
Here is a link to a slashdot discussion on Java profilers: http://ask.slashdot.org/article.pl?sid=06/06/30/0053237
我没有使用过 Netbeans profiler,但尝试过 JProfiler、Yourkit 和 JProbe。 我发现Yourkit稍微好一些(主要是因为可用性方面而购买的)。 其中一些有用的功能包括:(您可以检查它在 Netbeans 中是否可用)
您可以在他们的网站上查看更多详细信息。
I've not used Netbeans profiler, but tried JProfiler, Yourkit and JProbe. I found Yourkit slightly better (mainly bought by the usability aspect). Some of the useful features in it are: (you can check if it is available in Netbeans)
You can check for more details at their site.
我想说的是,准备好使用和更多的性能统计数据。 去年,当我在一家跨国公司实习时,我被分配了一份分析工作。 我使用了 InfraRED 分析器,它使用面向 Java 方面的 API(适用于 Aspectwerkz 和 AspectJ)。 但我必须扩展分析器才能得到经理想要的东西。 此外,分析器给出的性能统计数据也是有限的。
但在选择分析器之前,我研究了一些其他开源分析器。 其中一些是微不足道的,不符合我们想要的。
我还要补充一点,其中一些根本不起作用。 例如,如果我们想要收集 Web 应用程序的性能统计信息,所有分析器都不支持我们所需的这些统计信息。
I would say that, ready to use and more performance statistics. I was assigned a profiling job last year when I was interning at a multinational. I used the InfraRED profiler which uses Java aspect oriented API (works with both Aspectwerkz and AspectJ). But I had to extend the profiler to get what my manager wanted. Also, the performance statistics given by the profiler was limited.
But before selecting the profiler I researched a few other opensource profilers. Some of them were trivial and didnt suit what we wanted.
I would also add that, some of them just doesnt work. For example, if we want to collect performance statistics of a web application, all the profilers doesnt support those statistics required for us.
借助完全独立的分析器,可以更轻松地将其与工具链中的其他应用程序集成。 例如,假设您希望在构建过程中运行探查器(例如,每晚一次)。 像 JProfiler 这样的东西很容易与 ANT 集成,而内置于 IDE 中的分析器可能会也可能不会。 如果您有一台单独的构建计算机,那么安装探查器的本地副本是有意义的,但仅仅为了访问一个组件而安装整个 IDE 则没有意义。
With a completely independent profiler, it's much easier to integrate it with other applications in your toolchain. For example, say you want to run the profiler as part of your build process (say, once a night). Something like JProfiler easily integrates with ANT, whereas profilers built into IDEs may or may not. If you have a separate build machine, installing a local copy of a profiler makes sense, but installing a whole IDE just to get access to one component does not.
如果您使用 Tomcat,您可能会考虑 lambdaprobe
http://www.lambdaprobe.org/
(它用于自由的)
If you are using Tomcat you might consider lambdaprobe
http://www.lambdaprobe.org/
(It is for free)
根据我的经验,YourKit 分析器是最有用的一个。 可用性方面的小事情确实很重要,但它也是最全面的,包含:
除此之外,它还在不断改进,所以谁知道未来持有什么:)
From my experience, YourKit profiler is most usable one. Small usability things really make the difference, but also it is most comprehensive one, containing:
Among other things, it's also constantly improving, so who knows what is future holding :)
比较这些功能,看看您是否真的需要商业软件而不是免费软件提供的功能。 如果是的话那么值得投资。
Compare the features and see if you really need the features provided by commercial software over the free one. If yes then its worth investing.