# Java Profilers
Mmm, says I, It Is Time I Learned To Use A Profiler, to see exactly what's Going On. I did a quick search and found a few candidates.
First off I found and tried JMechanic - an Eclipse plug-in, meaning that (Eclipse does rock, y'know), you have your profiling tools integrated into your debugger. jMechanic told me that up-front, half my app's execution time is spent in getDocumentByUNID(). Hardly a surprise, but instructive nonetheless. My next step was to take a peek at the heap, but JMechanic falls foul of a known Java bug when it tries to access the heap on pre-1.4.2 JVMs (I was using 1.4.1_02). I tried upgrading to JVM 1.4.2_03 and with that I couldn't even start the debugger - Eclipse hangs at the "Establishing debug connection..." part of the launch process. So much for that.
Next, I stumbled across Eclipse Profiler. Not as easy to get running as jMechanic, since you have to copy a dll into your JRE folder, and the project documentation isn't too clear (there are two downloads, and it seems one is needed, not the other, and I'm not sure what the difference is). Anyway, it's moot, because it also chokes on the 'Establishing debug connection...' step. You can cancel, so Eclipse hasn't crashed-crashed, but I still can't run the profilers.
So the common denominator seems to be my new JVM. More homework to follow. I'm also going back to basics, and trying to get cosy with hprof, which is Java's built-in profiling utility. Since the above Eclipse plug-ins rely on hprof to do their thing, it makes sense to learn the basic tool, and take it from there.
If you have any experience with other cool easy-to-use, open-source profilers, I'd love to hear about it.
File under: java : {2004.03.07 21:36}