Under what circumstances can a JVM suddenly crash?

I am running the daemon java process on my ubuntu machine:

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

The process runs for an arbitrary period of time, and then simply disappears. Nothing in LOGs, err.log, a JVM emergency file (hs_err _ *. Log) is created, nothing. My two questions are:

1) Under what circumstances can the java process terminate?

2) Is there a way to find out what happened to the process (knowing the PID)? Does UNIX provide ready-made process information in any way?

+3
source share
3 answers

1) Under what circumstances can the java process terminate unexpectedly?

, , , SIGKILL. oom, Linux. ?

2) , ( PID)?

,

UNIX -?

, Unix, , - . echo $?

265, , 9 (=265-256).

+3

script, - JVM. , JVM.

#!/bin/sh

# Launch JVM and wait...
java -cp ...

# do something with the exit code $?
# log it to a file or mail it yourself

, - .

0

I would run it as a daemon with YAJSW , as it allows several ways to control memory, etc., has restart options, and you can also enable log on the wrapper process so that you can have a lot of information when there is a problem.

0
source

All Articles