Minecraft Server keeps crashing out of memory, but stil empty swap left

I am trying to run a spigot server on my ubuntu vps (openVZ). The problem is that I receive "Killed" messages that shuts the server down. After a bit research i found out that there is not enough memory, but i have the min and the max memory (java) set to 512M (before i had 1G but there were even more crashes). I understand why processses are killed because of too much ram usage, but I dont understand why these processes are not using the swap (2gb).

Thanks for your allways fast answers.


PS: back in the dasy, i had the same server running without any problems. I dont know what I am doing wrong right now

3 Answers

You can allocate manually how much RAM java can use for minecraft. From Minecraft Wiki

Using the Xms and Xmx parameters, the initial and maximum memory size for Java can be specified. By default, your server runs with about 100 MB of RAM, which is very little. Most people will change their server to run with more, for example:

java -Xms512M -Xmx1G ...
java -Xms1024M -Xmx1024M ...
java -Xms1G -Xmx2G ...
1

Java memory handling is a bit special.

I don't know it much in details, but you should perhaps rise XMX and XMS settings.

Minecraft won't use your swap : it's a dedicated space managed by linux kernel : if your system runs out of memory, the kernel will decide to swap informations, but JAVA will first limit Minecraft server to the memory size you allowed it via command line.

Your server did run well last days, because MineCraft do expand his "map storage file" as the map is visited/crafted.

So, first days, your map was small enough to fit in allocated memory, and then I suppose it did growed as players crawled around...

7

You could go to the software center and search for mc-server and this application will pop up a mc server installer install the application agree to the eula then if you want change the server.properties. In the snap menu with the mc server installer you get to choose how much ram you want like 4G 2G and up to 12G

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

You Might Also Like