What is the Java equivalent of a Linux coredump or Windows minidump? I've read about heap dumps and it looks like what I want, but how to trigger them (automatically) on uncaught exceptions?
I know about the uncaught exception handler and I'm already using it to print the exception + stack trace and terminate the whole application (otherwise the thread dies and the application keeps running? huh?) Also I found this post about how to record heap dumps from code, but if I do that from the unhandled exception handler Java already has caught the exception and the stack trace (and arguments) are gone.
I came across the -XX:+HeapDumpOnOutOfMemoryError
flag which seems to do what I need, unfortunately only for out of memory exceptions and not for other uncaught exceptions.
That's the only things I've been able to get out of google so far. Currently I'm using an attached debugger with exception breakpoints, but that is impractical because it also breaks on handled exceptions, so it can't be used unsupervised.
[update on motivation]
I want to be able to examine the arguments and local variables of the stack trace to figure out what caused the exception. Its usually null reference exceptions or assertions that fail, and I cannot always guess from the line number what exactly went wrong. In C/C++ I'm used to crash with a coredump/minidump and then examine further what has actually led to the crash.