This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GCJ Thread Dump


Martin Egholm Nielsen wrote:
Hi Mark,

> Is there any way to get a thread dump from a running GCJ application in the > same way you can send a kill -3 signal to the Sun JVM?
No, there isn't, and it would be extremely hard to do. Whan we have a
problem like this, we attach gdb to the process.

This not my alley, as I don't know what the outcome of kill -3 does to Sun's JVM. However, can you perchance use the dump mechanism that David Daney mentions in the thread http://gcc.gnu.org/ml/java/2005-02/msg00037.html:


"I have code that does a heap dump that I would be good to put in the interface as well. Given the heap dump and a post processing program we generate things like the number and type of each reachable object as well as the value of each String."


Unfortunately I just dump the heap, not the stacks. Once you start trying to generate stack traces from stack dumps, you have to have some target specific code.


You would have to do something similar to the GC's stop-the-world and then dump out the stacks and current stack pointers for each thread. You would also want to obtain the owners of all locks held. It makes my head hurt just to think about it.

David Daney.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]