Skip to main content

The Profiling Guy

Posted by gsporar on April 7, 2005 at 6:50 PM PDT

I used to be on a team that maintained a complicated web application that was leaking huge amounts of memory. Even when set to 2 gigabytes, the heap would run low on space, which slowed performance to a crawl as the garbage collector furiously ate up CPU cycles. Eventually an OutOfMemoryError would occur, which slowed performance all the way to a stop.

To diagnose the problem I ended up using JFluid, which at the time was an experimental profiling technology developed by Misha Dmitriev. I was impressed enough with JFluid that I wrote an article about it for Java Developer’s Journal. After the article was put online I sent the URL to a former colleague who had worked on that complicated web application.

He sent back a one sentence response: “Cool – I’ll forward this to our profiling guy.” His response stopped me in my tracks: isn’t everyone a profiling guy (or gal)?

I realize part of my reaction is personal preference: I enjoy making code run faster and use less memory. Not everyone, however, finds this task terribly rewarding. And on projects where resources are limited the goal of “get it right” must come before “make it fast and efficient.” Frequently the “make it fast and efficient” task never gets started, much less completed.

But there is more at play here than personal preference and limited resources. Historically, Java profiling tools have been less than friendly. Some of them are hard to configure/use, others are underpowered, quite a few impose significant runtime overhead, and some are commercial products that are fairly expensive. JFluid, however, was different. It was easy to use, had the features I needed, provided control over the runtime overhead it imposed, and was available for free.

As a standalone tool it was perfect for someone like me who seeks out such tools. To reach a wider audience, however, profiling has to be integrated into the developer’s edit-compile-debug-test workflow. Toward that end, the JFluid technology has been put into NetBeans as its profiler. There’s even a tutorial available.

As a result, I have hope that someday everyone will be a profiling guy (or gal).