Kill server when running out of memory

This commit is contained in:
mathiascode 2019-10-04 15:03:40 +03:00
parent 11141b5b6e
commit c300542106

View file

@ -2,7 +2,7 @@
while true; do
stty intr undef
tmux new -d -s alivecheck 'sh -x script/alivecheck'
java -Xms384M -Xmx384M -Xmns192M -Xmnx307M -Xtune:virtualized -Xaggressive -Xcompressedrefs -Xdump:none -Xgc:concurrentScavenge -Xgc:dnssExpectedTimeRatioMaximum=3 -Xgc:scvNoAdaptiveTenure -Xdisableexplicitgc -Xshareclasses -XX:-HeapDumpOnOutOfMemoryError -XX:MaxDirectMemorySize=64M -XX:+UseContainerSupport -Dpaper.playerconnection.keepalive=360 -DIReallyKnowWhatIAmDoingISwear -jar minecraft-server.jar --world-dir=worlds
java -Xms384M -Xmx384M -Xmns192M -Xmnx307M -Xtune:virtualized -Xaggressive -Xcompressedrefs -Xdump:none -Xgc:concurrentScavenge -Xgc:dnssExpectedTimeRatioMaximum=3 -Xgc:scvNoAdaptiveTenure -Xdisableexplicitgc -Xshareclasses -XX:-HeapDumpOnOutOfMemoryError -XX:OnOutofMemoryError="pkill -9 java" -XX:MaxDirectMemorySize=64M -XX:+UseContainerSupport -Dpaper.playerconnection.keepalive=360 -DIReallyKnowWhatIAmDoingISwear -jar minecraft-server.jar --world-dir=worlds
tmux kill-session -t alivecheck
sleep 1
done