9

I recently started a vanilla Linux Minecraft server (v1.7.2) and have been having trouble with high RAM usage causing the server to disconnect. I have allocated a maximum of 3.5 GB.

I restarted the server an hour ago and have been monitoring it. I noticed that when players disconnect, the memory usage doesn't reduce and as more players join, the memory usage just increases.

  • With 5 players logged in, the RAM usage is at 63% (2.1 GB).
  • With just 3 players on the server, memory usage is 58.9%.

I am also getting this error when starting the server:

Your platform does not provide complete low-level API for accessing direct buffers reliably. Unless explicitly requested, heap buffer will always be preferred to avoid potential system instability.

The command I am using to start the server is:

java -Xms512M -X3584M -jar minecraft_server.jar

What could be causing the high memory usage and why doesn't it reduce when the player count reduces?

8
  • Vanilla or bukkit? Also what version are you using?
    – aman207
    Dec 5, 2013 at 16:31
  • 100%vanilla, 1.7.2
    – crmepham
    Dec 5, 2013 at 16:32
  • What is the command you use to start the server?
    – 3ventic
    Dec 5, 2013 at 16:34
  • Java -Xms512M -X3584M -jar minecraft_server. Jar
    – crmepham
    Dec 5, 2013 at 16:38
  • 2
    Detailed hardware specs / OS version / Java version would help.
    – John
    Dec 5, 2013 at 20:18

4 Answers 4

7

I see a number of possible problems that may help your server run with less ram.

PlayerViewDistance

On many servers, including my own, the ViewDistance parameter in your server properties file may be too high. Decreasing this value will cause less chunks to be loaded for the players, but if you set it too low, ie below 3, then you won't be able to see far enough to have a good time playing.

This is easily fixed by decreasing the "view-distance" parameter in the server.properties file.

Command line args

I see a small problem with the one you pasted in your question:

Java -Xms512M -X3584M -jar minecraft_server.jar

I could not find a java argument that is simply 'X', although I assume that you are trying to set the upper memory limit to 3.5GB. Here is what that should look like:

Java -Xms512M -Xmx3584M -jar minecraft_server.jar

Or an even simpler version:

Java -Xms512M -Xmx3.5G -jar minecraft_server.jar

If you're willing to experiment, lower the maximum limit by 512mb every restart, and measure how it performs. In some odd cases, you may see a decrease in actual used memory.

Use Java 7

From my past experience, running on an Ubuntu server, running a Craftbukkit server under Java7 instead of Java6 used a noticeably lesser amount of RAM.

Switch to Bukkit

Although this may be an unwanted option for you, it definitely works. With Craftbukit there is a multitude of Plugins available for download on http://bukkit.org/ that help to increase server performance and lower resource usage.

0
0

"Normal" depends on where each player is and what is happening in loaded chunks.

If players are spread out, then more chunks are (obviously) going to be loaded, and more mobs will have to be dealt with. In addition, redstone contraptions are going to add many chunk updates to your world.

You need to understand that your mileage may vary. Some can live with just 1.5 GB, and some are going to have to deal with 3 GB. You may not be using swap space at all, and your JRE version matters as well.

So yes, 2 GB is normal when playing with 5 people.

-1

Try adding a garbage collection flag to the end of your JVM args

-XX:+DisableExplicitGC

And here is a couple more that are specifically for Minecraft

XX:+UseConcMarkSweepGC -XX:+UseParNewGC
7
  • 1
    What do these arguments do? Is there somewhere I can read up on them and how to use them?
    – crmepham
    Dec 5, 2013 at 17:51
  • oracle.com/technetwork/java/javase/tech/… To use them, add them after your memory declarations.
    – aman207
    Dec 5, 2013 at 18:03
  • Those arguments didn't help is still using a lot of ram. I noticed this error when starting the server: your platform does not provide complete low-level api for accessing direct buffers reliably. Unless explicitly requested heap buffer well always be preferred to avoid potential system instability.
    – crmepham
    Dec 5, 2013 at 18:22
  • 6
    -1 There is no justification for using any of these flags that I can see. Disabling Minecraft's ability to run the GC when its convenient? Sounds like it would make things worse.
    – Resorath
    Dec 5, 2013 at 20:38
  • 1
    @crm The error message indicates a pretty clear issue with your JVM and your os. Are you sure that JVM is well supported on your os? Not obvious to me from what you've posted.
    – John
    Dec 6, 2013 at 18:56
-1

The memory usage doesn't decrease because the player's memory file is still on the server being stored, because of this the server still must remember information about the player for other plugins (If you have them) and even if vanilla just for the server itself to make sure it remembers where they were, their items, etc. I do not know how to fix this problem besides increasing your Memory. I only know about the memory as when I ran my own server locally I ran into the same issues and figured out when I deleted player's .dat it would decrease the server's memory usage. Also if you are using plugins for LogBlock or such it will be heavy usage on the server as it stores every single break, place, chest/furnace/dispenser/hopper/etc. opening, and more, this in turn creates a large amount of data usage. Anyways hope this was helpful.

2
  • 4
    Wrong, a player that logs off should cause the chunks around him to unload. The player.dat file is not kept in the RAM of the server, that's stored on the harddrive.
    – Arperum
    Apr 2, 2014 at 9:21
  • Files stored on ram go away after a system restart so thats the ptiof your bot saving player info there. Apr 2, 2014 at 16:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .