I have bought a VPS server with 2GB of RAM and Debian x64. When I want to run a Minecraft server with this command:
screen java -Xmx1600M -Xms1600M -jar craftbukkit.jar
but server keeps shutting down with information [screen is terminating], in logs I can find this: http://pastebin.com/YupAEnyN
Memory used by system is low: https://i.stack.imgur.com/2Yrl2.png
Unfortunately I can’t make swap because VPS is working under OpenVM.
What should I do if I want to run server with as much RAM as possible? Server is running with -Xms1536M -Xmx1536M but I’d like to get more…
Thanks for advance!
I have bought a VPS server with 2GB of RAM and Debian x64. When
Share
I think you need to reduce the memory settings instead of trying to increase them.
Notice that the error was
Native memory allocation (malloc) failedThe -Xmx flag increases your Java heap memory. It makes more memory available to Java code. However, that’s not where your problem is. Java has plenty of memory. The error indicates that native code is running out of memory.
Let’s say that with your 2GB of RAM that the Java process will have 1.7GB available to it. This is an operating system defined limit that absolutely cannot be exceeded. (I don’t know what the real value is for your system, I’m just pretending that it is 1.7GB) Now you specify the -Xms1600M. You have just reserved 1.6GB for Java code and left a minuscule 100MB for any other native code.
If it were me, I would start with -Xms1024 -Xmx1024 giving 1GB for Java code and several hundred MB for the other native code. Only when the process starts getting OutOfMemory exceptions in Java code (not native code) would I consider raising these values.
This whole thing is rather counter-intuitive. For a much more in depth explanation see the article at:
http://www.ibm.com/developerworks/linux/library/j-nativememory-linux/index.html