Wednesday, December 31, 2008

Stabilizing AsyncGetCallTrace

AsyncGetCallTrace() is the unofficial interface for low overhead CPU profiling in the JVM. It allows CPU profilers to use a signal (SIGPROF) to collect samples of stack traces. Unlike many Java profiling tools out there that instruments bytecode, it has much lower runtime overhead. The problem was that it's a bit unstable and sometimes caused JVM crashes in OpenJDK6. So, I backported the change

http://hg.openjdk.java.net/jdk7/jdk7/hotspot/rev/93b6525e3b82

into OpenJDK6 b11 (the patch attached) to avoid JVM crashes in the
AsyncGetCallTrace(). The change appears to have been first introduced
in OpenJDK7 b27 (Hotspot v13-b01).

I sent the patch to the OpenJDK mailing list, but unfortunately it's not been accepted yet.

[Note: the patch is in Hotspot V14. So, upgrading to the JDK based on it will fix the crashes.]

1 comment:

Surya Baby said...

Good post. Keep blogging I came across a tool Java Thread Dump

Analyzer
which is very useful to capture thread dumps, Troubleshoot JVM crashes,

slowdowns, memory leaks, freezes, CPU Spikes. I hope it may help others too.