tags:

views:

2107

answers:

9

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?

A: 

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.

Bhushan
Thanks for answering. The whole point of this question was to get more knowledge than I could get by comparing data sheets - this usually requires hands-on experience.
Thorbjørn Ravn Andersen
+9  A: 

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.

Dan Dyer
Thanks for answering. I am not as such questioning the value of the tools, but merely what they can do that will warrant the trouble I need to take to be allowed to buy them. If you would take the time to elaborate on the "easier.." part I would appreciate it :)
Thorbjørn Ravn Andersen
Jprofiler has a free trial version if you want to try it out
Paul Whelan
The NetBeans profiler has a standalone version as well, but the NetBeans-integrated version may offer more features...
joeforker
Boo on Sun for not providing a decent profiler sooner, well-profiled code could really change people's perception of Java performance.
joeforker
TRA has a point: doesn't really address the question. I'm a big IntelliJ fan though. :)
cletus
NetBeans profiler stand-alone is called VisualVM
Kevin Day
VisualVM can be used with IntelliJ IDEA: http://plugins.intellij.net/plugin/?id=3749
Esko Luontola
+3  A: 

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

TofuBeer
@TofuBeer you should check out Netbeans 6.7 M2 or the Nightly builds as maven is properly supported now and should have profiling support.
Mark Davidson
Cool... unfortunatly the Wicket plugin doesn't work with that version... :-( But sounds like I'll have what I want soon - thanks!
TofuBeer
A: 

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.

rboorgapally
A: 

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.

Outlaw Programmer
+3  A: 

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.

Mark
+1  A: 

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)

  • J2EE Profiling (Eg. It shows how much time an SQL query took).
  • Snapshot comparison and annotation
  • Deadlock detector
  • Exception telemetry

You can check for more details at their site.

I founf the "find 10 largest objects" feature very useful.. YourKit tends to show you what you need to know better. I also handles very large dumps fairly well. e.g. over 1 GB.
Peter Lawrey
A: 

If you are using Tomcat you might consider lambdaprobe

http://www.lambdaprobe.org/

(It is for free)

Luixv
A: 

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

Sarmun
Could you say more about the overhead of YourKit? I have problems with the high overhead of JProfiler when in "dynamic sampling" mode. Can I profit from YourKit's low overhead and get invocation counts?
quant_dev