JavaPulse

a finger on the pulse of the freelance Java™ market in the Netherlands

Java Profiling

Posted on | 28 March 2007 |
Tags: | |

A while back, I was tracking a memory leak in an application and was able to track it down using a trial version of JProbe Memory. Because I was dealing with a monstrous piece of old code, the massive amount of data produced (i.e. the amount of time spent in each method over a set timespan, where you have to go deep into a tree) was not really helpful to see where the leak was. Instead, I continuously cut the application down by taking out pieces of code until the realtime line graph of the memory usage no longer showed an increase in memory. So, the profiler was a helpful tool in the diagnosis of the problem, but it’s really good old-fashion deduction that did it.

Since I fixed that memory leak, I haven’t had a chance to look into profilers and am just lately wondering about to do some performance profiling. The realtime graphs in JProbe has an advantage over cheaper options (no pricing on the website, since it’s really for big companies who care to profile).

What is your experience with profilers?

Comments

One Response to “Java Profiling”

  1. heikki
    July 24th, 2007 @ 14:06

    If you’re using a profiler just to look at the memory graph, you don’t need such a tool at all, you could just write out the heap size periodically while reducing your code.. besides you can generally hide uninteresting profiling data by applying a filter on package / class name / method name / whatnot. In the past I’ve used JProbe as well, and found it quite useful to exactly pinpoint The Leak by using the option to “subtract” two heap dumps. Any objects in there that you don’t expect are suspicious.

    Other than this I’ve recently used the profiling capacities of Rational Application Developer and related IBM derivatives from Eclipse. Overall experience less pleasing than at the time with JProbe, but it generally does the job — although a similar heap dump diff somehow did not show my leaking test array of a million strings (?!) — although it was clearly visible in the live objects view. I believe there’s a very similar thing for standard Eclipses, called TPTP.

Leave a Reply