Two must-have Java tools
I’ve been absolutely loving JavaRebel, a java agent that reloads modified classes at runtime, thereby obviating the need to start or stop some long running piece of code (say, an app server or some other kind of daemon). It’s not, unfortunately, open source, but it is inexpensive and the time savings so far are considerable. I ran it for three weeks using their free trial version expecting to find some kind of showstopping bug… but that never materialized. Integrating it is really easy… just a simple change to the command line that runs your java code. I’ve only found one caveat that requires any thought at all, which usually has to do with the modification of static fields, but it’s really not a big deal. I reckon that this saves me 15 minutes per day, which… well, it’s quite a lot. And I don’t remember the last time that I found software that could do that for me.
I also had a little incident with a 1.5Gb heap dump yesterday. I wanted to analyze it after one of our app servers coughed it up (right before it crashed hard) to find out what the problem was. I tried jhat, which seemed to require more memory than could possibly fit into my laptop (with 4Gb). I tried Yourkit, which also stalled trying to read this large dump file (actually, Yourkit’s profiler looked pretty cool, so I shall probably revisit that). I even tried firing up jhat on an EC2 box with 15Gb of memory… but that also didn’t work. Finally, I ran across the Eclipse Memory Analyzer. Based on my previous two experiences, I didn’t expect this one to work…. but, holy cow, it did. Within just a few minutes, I had my culprit nailed (big memory leak in XStream 1.2.2) and I was much further along than I was previously. I actually downloaded the standalone version… I usually don’t need memory analyzers very often, so I didn’t want to saddle my regular Eclipse with something new. I highly recommend this tool – it worked like a charm with a very big file and was also very easy to use.
Great, that JavaRebel is working so well for you. I do save more time a day using it but this boils done to development habits and what exactly one does.
Just pointing out that JavaRebel itself is just a javaagent (also called a JVM plugin) and not an Eclipse plugin.
Yes, of course… it’s most certainly not an Eclipse plugin. I’ve updated the post to reflect that. Thanks!