I have a minecraft server running in a VPS and sometimes my server is being killed unexpectedly.

I don't believe this is a java error because no error is thrown and this happens when the server is running nicely, also I see a message from my script that calls the java command saying that the process has been killed and also tells me the process id and the line in the sh script that was killed:

My script:

#!/bin/sh cd /home/minecraft/server FILE=mcpc-plus-legacy-1.4.7-R1.1-SNAPSHOT-f534-L31.jar #LOG="log`date +'%Y-%m-%d.%H:%M:%S'`.log" while : do LOG="log`date +'%Y-%m-%d.%H:%M:%S'`.log" echo "Iniciando..." >> "$LOG" rm log-latest.log ln -s "$LOG" log-latest.log java -Xmx7680M -Xms4096M -XX:MaxPermSize=192M -jar "$FILE" 2>> "$LOG" #-Dcom.sun.management.jmxremote \ #-Dcom.sun.management.jmxremote.port=9010 \ #-Dcom.sun.management.jmxremote.local.only=false \ #-Dcom.sun.management.jmxremote.authenticate=false \ #-Dcom.sun.management.jmxremote.ssl=false \ # -jar "$FILE" >> "$LOG.std.txt" 2>> "$LOG" echo "Aperte CTRL + C para cancelar" sleep 5 done 

The message that is displayed when the process is killed:

/home/minecraft/server/acao_iniciar.sh: line 22: 23546 Killed java -Xmx7680M -Xms4096M -XX:MaxPermSize=192M -jar "$FILE" 2>> "$LOG"

There's no cronjob configured and the last command doesn't show any strange connection through SSH.

5

1 Answer

One likely reason is that your server is running out of memory and the process is being killed by the OOM killer. This is a mechanism in Linux that will kill low priority processes when the system is running out of memory.

If this is the case, you should be able to fix it by i) reducing the amount of memory you allow your java process to take, ii) increasing the process' priority (nice -15) or iii) increasing your available memory.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy