Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java - under which circumstances may a JVM abruptly crash?

I'm running a daemon java process on my ubuntu machine :

java -cp (...) &> err.log&

The process runs for a random period of time and then just disappears. Nothing in LOGs, err.log, no JVM crash file created (hs_err_*.log), nothing. My two questions are :

1) Under which circumstances can a java process abruptly finish ?

2) IS there any way to know what happened to the process (knowing PID) ? Does UNIX keep information about finished processes somehow ?

like image 445
kms333 Avatar asked Dec 05 '25 02:12

kms333


1 Answers

1) Under which circumstances can a java process abruptly finish ?

When it exits by its own but I guess you ruled out that or when it is killed with SIGKILL. This might be the oom killer if you are on Linux. Did you look at the system message logs ?

2) IS there any way to know what happened to the process (knowing PID) ?

Generally not unless you configure some tracing tools to get that information

Does UNIX keep information about finished processes somehow ?

No, but depending on the Unix variant you are using, that might be something simple to add. In your example, you can just print the process exit status with echo $?

If it is 265, that would mean the process was killed with signal 9 (=265-256).

like image 135
jlliagre Avatar answered Dec 06 '25 15:12

jlliagre



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!