What advantages have a commercial Java profiler over the free ones, e.g. the one in Netbeans?

后端 未结 9 996
我在风中等你
我在风中等你 2020-12-29 13:25

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 th

相关标签:
9条回答
  • 2020-12-29 13:50

    From my experience, YourKit profiler is most usable one. Small usability things really make the difference, but also it is most comprehensive one, containing:

    • most comprehensive and usable memory snapshots (working also with 1GB+ heaps), with detail object view and primitive data, for every single object. (for example in hashmap you can see if objects are evenly distributed or most are stored in same bucket!) This detail of memory snapshots and its ease of use is my main reason for yourkit.
    • very little overhead (far less then many other profilers I used)
    • comparing snapshots
    • J2EE profiling
    • deadlock detector, lock status (I think it still misses java.concurrent.locks, bud for synchronized it is great)

    Among other things, it's also constantly improving, so who knows what is future holding :)

    0 讨论(0)
  • 2020-12-29 13:52

    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.

    0 讨论(0)
  • 2020-12-29 13:56

    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

    0 讨论(0)
提交回复
热议问题