Java: do all processes work under one JVM?

We have a Linux server that runs about 20 java programs. These Java programs are identical, except that they use a different port. These programs work fine. However, after some time, all 20 programs fly out at the same time. Each of these programs is allocated 2 gigabytes of memory, starting them as follows:

java -jar -Xmx 2000m

However, as far as we know, these programs hardly come close to using these amounts of memory. The whole system has 4 gigabytes of memory.

SO, the question is, can a java program be responsible for the failure of all 9 others? Is the VM virtual machine partitioned so that when it crashes all java crash programs? Is there a log file that I could check due to a java failure? Java output did not detect errors.

EDIT: It is strange that this happened after a longer time, such as 3 hours. These 20 processes have been running for quite some time before suddenly everything collapses at the same time. And why are they ALL crashing if java runtime starts its own process for each program?

+3
source share
7 answers

It's hard to say exactly why all Java processes all exit at the same time. It is not even clear why they are dying. To diagnose these problems, I would:

  • GC; "-verbose: gc",

  • , , "" ,

  • , , .

, java -jar -Xmx2000m ... 20 , 20 , 2 . 4 . (40 ) , , , - . , .

, , , , . Java, , . ( , JVM .)

, , - , JVM, JVM. , , :

  • , ,

  • , ..

  • GC , ,

+7

, 2 20 , 4 . , , , .

+5

- java.exe . , 20 , 20 JVM, 2 . 4 , , , .

+3

Java . ( , ), .

, Java - . Linux, , , , . , .

, , 2G, 40 , . , , - 200M ( , ), .

, , , , ​​, , 1 2 . , , ( ​​ ), , ... .

+1

, Sun JVM -Xmx2000m 2 . , .

, , .

JVM, Sun, ; , JVM.

Java -, , .

- , , . , , .

+1

java -Xmx . 2gb, -Xms. , .. Java.-Xmx2000m -Xms2000m. "java -X" .

jvm , . . , , , , - .

0

Sounds like the work of the scary Linux OOM Killer (no, that's not a joke). as others have already pointed out, you are probably overlaying the memory on the box, and the OOM killer tends to orient processes with large resident memory (e.g. jvm).

0
source

Source: https://habr.com/ru/post/1728631/


All Articles