TrapII
TrapII

Reputation: 2275

How does a Java process die?

A quick answer would be "without crying" of course :).

I have a really strange problem with my Java application (J2SE 1.7) on a Win7 32bits system. I encountered all the cases :

So my question is :

Upvotes: 2

Views: 476

Answers (2)

Thomas Weller
Thomas Weller

Reputation: 59513

How can I be sure this is a native exit call as I don't have all the code of native libraries I am using?

Debug it.

Is it possible to have this strange behaviour produced by another mean?

Hard to tell... Could be threading, could be memory leak, ...

Finally how to debug and track which lib can be the root cause?

Run Java with

-XX:+CreateMinidumpOnCrash

and you'll get a crash dump that you can analyze. Or use

-XX:+UseOSErrorReporting

to let Windows handle the crash (which will e.g. show a message to attach a debugger, depending on what you have installed. It might as well show "Send to Microsoft" error report.).

Upvotes: 1

WillShackleford
WillShackleford

Reputation: 7018

how can I be sure this is a native exit call as I don't have all the code of native libraries I am using ?

The only way I know to be sure would be to wrap the call to a native library with logging commands so you log before each call and after each return. After your program has crashed if the log has an enter message but no return message then that library call is suspect.

Is it possible to have this strange behaviour produced by another means ?

Yes there are an infinite number of strange other means. Using up memory or some other resource might be one explanation.

Finally how to debug and track which lib can be the root cause ?

Logging described above should find this too if the messages are specific to which library is being called. You can monitor the application in jconsole to see if it is using up tons of memory or threads. Disable anything that can be disabled so you can eliminate it as being part of the problem. If the problem goes away enable things one at atime until the problem returns.

Upvotes: 1

Related Questions