Java

Teaching Java How to Commit Suicide

At $work, we have a lot of java processes that are ran via cron and other wrappers that do some pretty critical tasks. The apps have been written so that the whole thing is wrapped in a try/catch that will call system.exit(1) should something not go right. Our wrapper scripts watch for a non-zero exit code, and alert Nagios if something went wrong.

Hudson > (CruiseControl * 2)

CruiseControl and I have never really gotten along.  When you're a Java shop, you have to use continuous integration. In fact, if you're a code shop, you need CI. For the longest time, CruiseControl was the only kid on the block.  I'd heard about Hudson quite a bit, but I didn't take the time to try it.  Why not?  Well, because CI is hard, and it takes forever to get setup right -- I didn't want to have to re-invest all that time.  Man, if only I'd known how wrong I was.

Profile your Java GC Performance with GChisto

I stumbled across GChisto the other day when looking for some garbage collection analysis tools for Java. Anyone who's tried tuning Java GC (especially on older JVM's) knows that it's about as much fun as watching paint dry. However, many times you can seriously improve performance by taking the time to analyze what your GC's are doing. GChisto attempts to give you a birds-eye graphical view of your GC operations, and has a very handy comparison feature that allows you to compare the differences between GC logs.

Profiling your Java 1.4.2 memory heap

New Java 6 devs and admins get all the fun. New toys, better performance, more auto-tuning -- yet you get stuck supporting a legacy java app that you can't upgrade past 1.4.2. Well, provided you have a more recent 1.4.2 JDK, you can use jhat too!

The key is to have your app do a heap dump when sending it the QUIT signal. Append this option to your java options on startup of your application:

Subscribe to SysAdmin's Journey RSS