views:

90

answers:

2

So far I have learned about generating thread dump and heap dump using jstack and and jmap respectively.

However, jstack thread dump contains only texts describing the stack on each thread. And opening heap dump (.hprof file) with Java VisualVM only shows the objects allocated in the heap.

What I actually want is to be able see the stack, to switch to particular stack frame, and watch local variables. This kind of post-mortem debugging can be done normally with tools like WinDbg, gdb and a core file (for a native C++ program.)

I wonder if such 'core' file (which will allow me to debug in non-live environment) exists in Java?

+1  A: 

I don't think such a dump mechanism exists in standard Java.

Stephen C
+1  A: 

I've found relevant information in a Sun forum and in an SO discussion: I have not had much luck with it, but it might work in your case.

Note: some of the tools mentioned are Java tools, but are unsupported and are not available on Windows versions of the JDK.

Tomislav Nakic-Alfirevic
Thanks. I think `jsadebugd` is very close to what I'm looking for.
m3rLinEz