I have a Linux server (Debian 10, 16GB physical memory) with three docker containers running on it and two Java programs that perform financial calculations.
Docker containers:
- One is NGINX
- One is Database postgresql
- One is keycloak (authentification)
So nothing special.
Java-Programs:
These programs are started as follows. Note the -Xmx10g
parameter:
./java/jdk/bin/java -Xmx10g -jar portal-backend-1.0-SNAPSHOT-runner.jar 2>&1 >> log/portal.log &
./java/jdk/bin/java -Xmx10g -jar pea-backend-1.0-SNAPSHOT-runner.jar 2>&1 >> log/pea.log &
SWAP-File:
Configuration of my 24GB swap-file:
fallocate -l 24G /swapfile
chown root:root /swapfile
sudo chmod 0600 /swapfile
Format swapfile:
mkswap /swapfile
Activate swapfile:
swapon /swapfile
In the file “/etc/fstab” added:
/swapfile swap swap defaults 0 0
When I now type swapon -s
for status I get the following message:
Filename Type Size Used Priority
/swapfile file 25165820 0 -2
PROBLEM:
Even though I have activated a SWAP file
, I get an out-of-memory exception
. The interesting thing is that the SWAP file is always 0KB. It seems like it will never be attacked. What is wrong?
Attached a picture of htop
shortly before I get the message Out-of-memory-Exception