How to understand max ram to give to a server?

Discussion in 'Performance Tweaking' started by Skulz, Jun 25, 2015.

  1. Hello, I'm hosting my minecraft server on a ovh machine using multicraft. At the moment the max ram usage is set to unlimited on multicraft but when the server ram goes to 99% it swaps to hard disk and the server crashes, even if in Spigot using the mem command I can see different GB of ram still free. I think that multicraft keeps asking new ram to allocate to the machine even if it is out of ram? Setting a max limit on multicraft would solve the situation? I just wonder how much ram should I set there considering that the server has 16gb ram totally?
     
  2. What is your server based on? Factions? Prison?
    How many players do you have online at a give time?
     
  3. Atm I have a multiverse server with different worlds: faction, plots, kitpvp, skyblocks. I know that use a hub would be better but atm we are fine with that. We got 40 players online on average during afternoon. I would like to know the max ram i can give to it without multiverse causing crashes cause it is looking for extra ram that do not exist. We restart 1 time at day.
     
  4. the plot world can be very big try to reset the world maybay
     
  5. It would probably be best if you set a max limit for your memory. That way Multicraft shouldn't attempt to use more memory than is assigned to the server, although I'm not too sure if that will solve your problem with it switching to the hard drive. If the machine has 16GB memory, then set your limit to 15GB as you want to leave some RAM for the OS and system processes to run.

    Try it, and let us know.
     
  6. Im trying in these days. Until 14500 ram it still reaches 99% ram and swaps to hard drive (even if less, just 40%, before it was reaching 80-90% and crash) . Trying 14000 now. In the server there are also teamspeak and some scripts so they could get that extra ram. Ideally I wanna reach 95% +/- without swap to hard disk.
     
    • Informative Informative x 1
  7. Looks like you have a memory leak.
    Run "jps -l -m" to get a list of Java processes, and find the process Id of your server.
    Then run "jmap -dump:file=memory.map (your servers process id)".
    Then give us the contents of memory.map. (it will be huge so use Dropbox.
     
    • Friendly Friendly x 1
  8. Atm im fine at 96% ram usage and 20% Swap if im giving 13900 ram to the multicraft server. In the server there are some scripts that take 50-100mega each plus Minecraft itself gets almost 2gb ram so i think that calcs overall are correct.
     
  9. You should not be using 13900M for a server unless you have more than 100 players or a memory leak.
    If you want me to fix your memory leak, please follow the instructions above to give me a heap dump.