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

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.]

No comments: