Full Speed Debugging

I have to spread the word on the goodness that is the Java Hotspot runtime’s Full Speed Debugging.

I have measured the performance of Java code and observed that, essentially, running a JVM in debug mode incurs virtually no performance cost unless you are actually doing debugging (eg on breakpoints, stepping through code, etc).  This appears to be true even while you are connected to the debug process, but not intercepting the activity (such as launching processes from the Debug facility in your IDE).

So you can routinely start your JVMs, even in production, with remote debug turned on (& appropriate security of course). Whenever you feel like having a look, attach a debugger to the JVM and do some debugging, then disconnect and let it run on at full speed.

I have been using this technique alot with Heroes of Arcadia test-play and are loving it; if I observe weirdness in the game, I immediately stop, hook in with a debugger and examine the game state. No messing around trying to replicate the problem later.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: