Too much memory used!

Discussion in 'Performance Tweaking' started by J0ker98, May 22, 2015.

  1. I have allocated 12000 MB of RAM on my dedicated server for my Spiot 1.8.3 minecraft ( git-Spigot-870264a-0a645a2 (MC: 1.8.3) (Implementing API version 1.8.3-R0.1-SNAPSHOT) )

    There are my timings:

    What's causing the problem? I can't find it!
  2. Ultrabans, NoCheatPlus, CommandBook, Marriage & Herochat are taking up a lot. Are there any errors in the console?

    EDIT: They all seem to be for when the player is joining the server. I would suggest for you to PM the developers of those plugins, or if you haven't already.. Update to the lastest version of the plugins.
    #2 Aerh, May 22, 2015
    Last edited: May 22, 2015
  3. No errors in console, also when player make something like TnT cannons the TnT just get stuck and doesn't work, it works when it's alone... It is a memory problem? I also have ClearLag in my plugins, here's my configs:

    Something that I could do to fix this?
  4. His timings are less than a second - this is the kind of stuff that is going to show up.
  5. 6 Second timings, but just one second of ticks...Don't know but I think your host machine is the problem?
  6. Cldfire

    Cldfire Retired Moderator

    Uh. 12 GB's of RAM? That's WAAAAAY too much. Try 6.

    You even put it in the title of the thread lol
  7. If I put 6000 MB the memory used goes at 100%... Also, I don't think is my machine because I run other servers on it and they haven't problems.
  8. Maybe try the plugins in one of your other servers and see if it still happens?
  9. Noway that 1 player needs 6GB RAM
  10. How are you measuring memory usage?
  11. A timings report IS NOT how much memory is being used. It's almost completely irrelevant to how much memory a plugin is using, for that you need to take a heap dump and run it through an analyzer.

    Timings basically show how much CPU a plugin is using.

    You need to take timings for longer than 6 seconds, try 30 seconds - 5 minutes UNLESS you are trying to identify something causing lag spikes (which only last for a short time, thus short timings captures.)

    And same question as frash23: how are you measuring memory usage? I agree that 12GB is way more RAM that you'll ever need on a single spigot instance. 6GB might even be to much if you don't have a ton of plugins or players. Too much RAM allocated means the garbage collector has to spend a ton of CPU power sweeping through many gigabytes of allocated RAM, which can cause lag spikes while the GC does it's thing.
  12. Cldfire

    Cldfire Retired Moderator

    Yes, but if you have too much RAM allocated, it can affect CPU performance as well (garbage collector).
  13. I ninja'd you: edited that part in before I saw your post :p
    • Like Like x 1
  14. I see you have CommandBook installed: try measuring using it's /debug info command, which will tell you the total available (to be allocated, basically your -Xmx value), currently allocated, and free allocated memory. You don't have to worry about memory unless currently allocated = total available, and free allocated is low.

    I'm unfamiliar with how multicraft reads used/allocated memory.
  15. My CPU is good, it's just the memory that's being a problem... A player of my community wrote this:

    "When using TNT cannons it has came apparent that they are clipping onto an adjacent block even though their path is not being blocked. I wasted almost a whole stack of TNT because of this. I was doing research on possible mob spawning bugs. Mobs spawn in my base but not in my spawner. There is a memory issue which keeps the mobs from dispawning in an unloaded chunk even when a player moves 128 blocks away. Tested on several servers and single player. Mob enity clear will not clear these mobs. So people with non natural mob spawners and log off without killing the mobs and turning on the lights will cause these mobs to be stuck in memory and forced into the natural mob cap. My spawner with no one on should be producing 4 times as many as it does now but can't due to this bug. So for the server sake to limit the issue is to kill all mobs from non natural mobs spawners and put light down and warp to spawn then log out. This won't fix it but will help."

    Ok, /debug info tells me:

    Free allocated memory: 8350.0 MB
    JVM allocated memory: 9814.0 MB
    Available total memory: 9814.0 MB
    Available processors: 8
    JVM: Oracle Corporation Java HotSpot(TM) 64-Bit Server VM 24.45-b08
    Java: Oracle Corporation 1.7.0_45 (
    System: Linux 3.10.23-xxxx-grs-ipv6-64 (amd64)
  16. You should listen to the people that have been running servers for a while, not a player who "did the research." Determine if memory is actually and issue first because I guarantee your spigot server does NOT need 12 gigabytes of RAM allocated to it. If it does: there's a memory leak and you should get a heap dump and analyze it. But first, do what we said above: check /debug info, and take timings for longer than 6 seconds.


    That shows you have 8.3 gigabytes free RAM (out of 9.8), but ALL of the available RAM has been allocated to your spigot instance (allocated != used), which is why multicraft shows 100%. Memory is not your issue.
    #18 Absentee23, May 22, 2015
    Last edited: May 22, 2015
  17. I've setted the memory to 10240 MB, as my main server does. After a restart my CPU is at 10% with 4 players online and memory usage is at 30%

    Edit: Ok so, do you know where the TnT problem comes from? Maybe from a ClearLag config?
  18. Stop using Multicraft's memory meter. Use /debug info, as multicraft does not account for free allocated memory. Unless you have hundreds of players online and dozens of plugins, you seriously, and I mean this: do NOT need that much memory allocated.

    No idea but here's how you troubleshoot if it is caused by a plugin:
    1. Remove all your plugins.
    2. Does it still happen?
      • Yes: its a plugin.
      • No: its an issue with the server setup (spigot.yml settings, or a bug in spigot/craftbukkit/bukkit/vanilla)
    3. If above is yes:
      • Add half your plugins back and see if the problem is with one of those.
      • If no issue after adding half, add the other half back.
      • If the issue reappears, the issue was with one of the plugins you added in the second half, start removing them one by one until you find it.
    #20 Absentee23, May 22, 2015
    Last edited: May 22, 2015