1. Guest, as per the stickied thread, this forum has not been in use since 2014. All bugs and feature requests should be posted to JIRA.

Crash Memory Leak, 16 GB ram + swap runs out in 1 hour

Discussion in 'Bugs & Feature Requests' started by Shicking, Apr 4, 2013.

  1. Hello everyone.
    I have a 250 player server that sometimes gets full.
    I upgraded from bukkit to spigot a few days ago, and that greatly improved my TPS.
    Unfortunately, spigot seems to have a different problem that has been plaguing me for the past couple of days.

    Spigot seems to have a memory leak. The memory consumption is steadily rising until it reaches 100% and eventually the server stops without anything in the log.
    To my understanding, the machine runs out of ram and swap and kills the java process.

    It happens fairly fast; I have 16 GB ram and it gets used along with the swap in around 1 hour or less if there are 200 players on the server.
    I am now upgrading to 32 GB ram to see if that helps, but it is obviously going to run for 2 hours.

    As one of the plugins could be doing it, I pasted a list of plugins + worlds.
    List of plugins and worlds:
    http://pastebin.com/zapPSJ0E

    Help? I upgraded most of my plugins yesterday, and it didn't seem to help.
     
  2. CustomForms

    CustomForms Retired Moderator
    Retired Supporter

    Use spigots /timings so we can see usage. Which bud are you using? Crash logs? We need more information.
     
  3. Ok, running it now.
    The things is, there are no crash logs. As I said, java just stops with nothing in the server log.
    The build that I am using is - Bukkit version: git-Spigot-735 (MC: 1.5.1)
    Should I update? I just upgraded to 32 GB ram.
    EDIT: Where does spigot put the info for timings? I am so new to spigot, and I can't find it in the server directory.
     
    #3 Shicking, Apr 4, 2013
    Last edited: Apr 4, 2013
  4. ./timings paste and give us the second link
     
  5. /timings reset

    < Wait 1 Minute >

    /timings paste

    2nd link, plz :)
     
  6. 1. Do you use the "greeting and welcome" flag with wg?
    2. MV-Portals uses too much
     
  7. Yes, I do use the greeting and welcome flag, should I take it away?

    I only have 6 portals with mv-portals.
    What do you suggest I do about mv-portals?
     
  8. In the config of wg theres a "use player move event" turn it to false
    Try to find an alternative for mvp.
     
  9. Updated:
    http://aikar.co/timings.php?url=5677538
    Also, doesn't /timings only tell you about the CPU usage? Or does it tell you about the ram usage too?
    The cpu usage is alright, the ram usage is the real problem
     
  10. Did you try my startup flags I gave you in the other thread?
     
  11. I think it's fixed; I just needed more ram.
     
  12. If it's a memory leak, adding more RAM might just delay it, though.
     
  13. Yea, it was a memory leak after all. It stayed at around 50% for a little while, then climbed up until the server crashed.

    Updated ticks:
    http://aikar.co/timings.php?url=5677942

    Help again?
     
    • Useful Useful x 1
  14. Did you try my launch flags? :p
     
  15. No, I didn't, since you didn't tell me how this would get rid of memory leaks.
    Can you please tell me?
    EDIT:
    I kind of figured it out; you were going to increase my garbage collection and stuff like that, so I will be sure to test it out as soon as I can!
    Thanks!
     
    #16 Shicking, Apr 5, 2013
    Last edited: Apr 5, 2013

  16. I've changed some bits, though, it might not make a difference, but here it is anyway. :p

    Code (Text):
    java -server -Xmn256M -Xmx14336M -Xms1024M -XX:PermSize=64m -XX:MaxPermSize=128m -XX:+UseParallelGC -XX:ParallelGCThreads=8 -XX:+CMSParallelRemarkEnabled -XX:+DisableExplicitGC -XX:MaxGCPauseMillis=50 -XX:SurvivorRatio=16 -XX:TargetSurvivorRatio=90 -XX:+UseFastAccessorMethods -XX:+AggressiveOpts -XX:+UseAdaptiveGCBoundary -XX:-UseGCOverheadLimit -XX:+UseBiasedLocking -XX:MaxTenuringThreshold=15 -XX:UseSSE=4 -XX:+UseLargePages -Djline.teminal=jline.UnsupportedTerminal -jar "{JAR}" nogui
    Mainly I changed the GC to a Parallel one, and halved all the memory sizes, not just the maximum. :p

    Again, you need an SSE4 CPU and Java 7 to run SSE4, and that's designed for an 8 threaded CPU, such as yours.

    Edit: Fixed it not working.
     
    #17 SN4T14, Apr 5, 2013
    Last edited: Apr 5, 2013
  17. java -server -Xmx'your-ram' -XX:+UseNUMA -jar craftbukkit.jar

    .
     
  18. He's running a 4 core 8 thread CPU, and is having memory leaks, you don't need NUMA unless you're using multiple physical CPUs, and it won't do anything except improve RAM read delay, plus my line is a nice way to assist with RAM leaks.
     
    • Useful Useful x 1
  19. Hey, hope you don't mind me asking but I cannot find a simple answer via Google; what does the flag UseSSE=4 achieve, and what are the accepted values? I understand ParallelGCThreads=8 is 8 threads, and therefore ParallelGCThreads=3 would be three, and default is 1...