H
halfdog
Hi everyone,
I've a problem debugging an application.
Background: Sometimes my application comes to a very unlikely state,
which at the moment results in an error message. The stack trace alone
has no great value, since this state is cause by the interaction of
more than one thread. The state is resolved throwing an exception, the
program continues normally.
Goal: If I reach this state, I want to suspend the application, dump
the complete state of all java threads, objects, ... (complete java
memory core dump) to analyse it later.
Question: Is there a possibility to generate such dumps?
Just thinking:
One posibility would be, to send a signal from the vm to some external
program (e.g. udp packet), this program attaches a standard OS-level
debugger (e.g. gdb under linux), dumps the core, resumes app, detach.
But I guess reconstruction of internal VM state from complete dump is
rather hard, is it?
I've looked at jdb, to see if it has some java-core-dump functions, but
it seems not to be so. Are there alternative implementations, or helper
scripts that make jdb loop over all java object addresses and dump
them?
Does someone known about the jdb remote debugging interface? Is the
protocol public, can I implement such a feature on myself?
I've a problem debugging an application.
Background: Sometimes my application comes to a very unlikely state,
which at the moment results in an error message. The stack trace alone
has no great value, since this state is cause by the interaction of
more than one thread. The state is resolved throwing an exception, the
program continues normally.
Goal: If I reach this state, I want to suspend the application, dump
the complete state of all java threads, objects, ... (complete java
memory core dump) to analyse it later.
Question: Is there a possibility to generate such dumps?
Just thinking:
One posibility would be, to send a signal from the vm to some external
program (e.g. udp packet), this program attaches a standard OS-level
debugger (e.g. gdb under linux), dumps the core, resumes app, detach.
But I guess reconstruction of internal VM state from complete dump is
rather hard, is it?
I've looked at jdb, to see if it has some java-core-dump functions, but
it seems not to be so. Are there alternative implementations, or helper
scripts that make jdb loop over all java object addresses and dump
them?
Does someone known about the jdb remote debugging interface? Is the
protocol public, can I implement such a feature on myself?