Pre-1.6.4 map uses significantly more RAM.

Discussion in 'Bukkit Help' started by pop4959, Oct 6, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    pop4959

    Maps from pre-1.6.4 (such as maps ported from 1.6.2) seem to use over 1GB more RAM than a freshly generated map.This causes a lot of problems for small-medium sized servers who run into frequent crashes and similar inconveniences.

    Tested using an old 1.6.2 map, and a freshly generated 1.6.4 map. Both maps loaded 256 chunks around spawn, with 0 players online. What I've found:
    • Old 1.6.2 map takes about 1.4-1.6 GB RAM, while new 1.6.4 map takes 400-600 MB.
    • Deleting tile entities, disabling mob spawning (and killing all existing mobs), as well as completely regenerating terrain in the spawn radius all have nearly no effect on the amount of RAM, even after a server restart.

    Does anyone know how to optimize new Dev servers for these old maps, or fix the maps themselves through some form of black magic? I know that many server owners such as myself do not wish to even think about a new map until 1.7 comes out. If you know anything, or have any ideas, please post here!


    (Edited from this, originally thought this was some Bukkit based memory leak or something like that)

    I've had a server for 2 years, and I know a memory leak when I see one. The only plugin I have installed recently is Coreprotect, as well as installing the 1.6.4 bukkit dev build.

    Does anyone know if either the plugin or bukkit has a memory leak? I have never run into memory problems, but recently it has slowly been going about 1-2 GB above average, causing the server to crash. This happens over about 12-36 hours.

    EDIT: May not be a memory leak after all, but bukkit seems to be using 1+ GB RAM more that it should be, and hovers around there. This was tested on a server with no plugins, and no players online.
     
  2. Offline

    Lolmewn

    Which plugins are you running?
     
  3. Offline

    Jade

    It's a dev build for a reason. We never claimed said build to be even remotely safe or stable.
     
  4. Offline

    pop4959

    Old Plugins (since before 1.6): AntiSwear, WorldBorder, AutoMessage, GroupManager, WorldEdit, CombatControl, PlayerHeads, LWC, TreeAssist, WorldGuard, Essentials, EssentialsProtect, EssentialsSpawn, EssentialsGeoIP, EssentialsChat, EssentialsAntiBuild.

    New Plugins:
    - CoreProtect (Old plugin named GriefLog stopped updating, broke with new bukkit builds).
    - PTweaks (In an attempt to fix the memory problem, previous to realizing it is likely a leak).

    I understand entirely, I simply mentioned this in the OP post because it is a recent change to my server. While it isn't guaranteed to any degree to be stable (I have experienced many instabilities in the past), it would be beneficial to know whether the most recent builds have known memory leaks, or not. If it does not, it's very likely to be one of my plugins.
     
  5. Offline

    Lolmewn

    pop4959 Tried running without plugins? This to see if it's one of the plugins or not.
     
  6. Offline

    GodsDead

    I pretty much have the exact same plugins you run apart from CoreProtect, I use grief prevention, as soon as I switched to 1.6.4 dev I get a crazy memory leak, shutting down my server, Completely stable with 1.6.2.
    If you find a fix, please message me.
     
  7. Offline

    pop4959

    I actually started testing this about an hour ago. I'll see what results I get from it, and post them here.

    GodsDead That's interesting. It's good to know that there is at least one other person with the same issue. If I (or we) find a fix, it will be posted here.
     
  8. Offline

    pop4959

    Lolmewn Seems to go up in RAM with and without the plugins, over time. At one point it did start hovering, but the usage is 1+ GB more than it should be, especially without players. I saw the server using anywhere between 1.2 and 2 GB of RAM without any plugins. Normally, the amount of RAM (with no players) would be something like 100-300 MB.

    This is a major problem, before 1.6.4, I always had at least 1 GB RAM to buffer my server (which has 3.5GB, 20 slots, 500MB reserved for Linux). It almost never went over 2.5GB of RAM before now.

    Any suggestions? From what I know, my server can't handle an upgrade above 4GB RAM (it is Linux, 64-bit, uses DDR2, 2 slots). I can barely remove any plugins, because they are mostly all essentials (no pun intended). I don't really want to be forced to buy an upgrade either, if it is even possible, as I don't profit from my server to begin with.

    Anyway, what causes 1.6.4 bukkit to take so much more RAM than 1.6.2, or previous? Unless only I'm getting this ridiculous RAM usage, I really do not know. The 1.6.4 patch barely contained anything, and again, my server ran perfectly for the last 2 years running bukkit since beta minecraft.

    At the very least, I hope this is fixed for future builds of Bukkit. At the moment I have updated to #2897.
     
  9. Offline

    Lolmewn

    pop4959 I guess the only thing you can really do is wait for a recommended build. You could also try adding some aggressive java garbage collection flags to your startup script, although that might have it suffer a bit performance-wise.
     
  10. Offline

    pop4959

    Lolmewn Sorry I'm not a programmer, so I wouldn't have any idea of how to make garbage collection flags, or something. :p It sounds like a good idea though, if I could, I would. The server's processor would probably be able to handle a little more work.

    Anyway, thank you so much for trying to help me! I really can't blame Bukkit since I using Dev builds, but I look forward to seeing better optimization in future builds. Again, not really a programmer, but I don't see what could possibly take 1GB more RAM, considering the 1.6.4 patch notes... which really didn't add anything spectacular.
     
  11. Offline

    Lolmewn

    pop4959 I used to have a whole bunch of flags. Now I only have these:
    -XX:MinHeapFreeRatio=1, -XX:MaxHeapFreeRatio=2, -XX:+UseG1GC, -XX:InitiatingHeapOccupancyPercent=0, -XX:MaxGCPauseMillis=100
    Try adding these before -jar craftbukkit.jar
     
  12. Offline

    pop4959

    Thanks a lot! I'll let you know if they work on my server.
     
  13. Offline

    JojoMojo3009

    To add on to this conversation, I would recommend removing PTweaks. It showed that this plugin isn't as stable at the moment.
     
  14. Offline

    pop4959

    JojoMojo3009 I removed this after I realized it wasn't helping (server kept crashing). It was purely a futile attempt to fix things, but thanks for the advice, I appreciate it!

    Lolmewn The tags you gave seemed to increase the initial RAM usage by about 1GB (~1.3GB to ~2.3GB). Doesn't seem like it worked. Thanks anyway!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 4, 2016
  15. Offline

    Lolmewn

    pop4959 Oh my :confused: When I used to use a load of these flags RAM usage went down from 1.5GB something to 800MB, I recall. Kinda crazy.
     
  16. Offline

    NoChanceSD

    Just wanted to say that i also noticed 1.6.4 using more ram, on my test servers which i usually give very little ram i'm getting some out of memory errors and never got any with previous versions of bukkit.

    I don't know if bukkit team already know this or not, so that's why i'm reporting here.
     
  17. Offline

    PolarCraft

    I used to have the same issue until i wiped my map.
     
  18. Offline

    pop4959

    I'm not deleting my map. There shouldn't be any noticeable difference between hosting my map on 1.6.2, or 1.6.4 respectively. That is why I created this thread. I see zero reason for Bukkit eating up much more RAM in 1.6.4 (which added almost nothing) in comparison to 1.6.2.

    Good to know that I'm not the only one noticing this! Hopefully Bukkit will be optimized again soon, so that it only takes as much RAM as it did for 1.6.2.

    Lolmewn Yeah, no clue why it didn't work for me. Cleanup tags sounded like they would help, but you know, they didn't. It was worth testing. Anyway, with the #2897 build I feel like the RAM usage has slightly gone down. With 2 players online (at 2AM, about 3 hours uptime) I measured ~1.4GB on the server. A few days ago when I posted this (using a more outdated build), I was using ~1.6GB with 0 players online )freshly restarted). The RAM also doesn't seem to crawl up as fast anymore.

    Might just be me hoping that it's getting better though. I could very well be going insane or something like that.
     
  19. Offline

    PolarCraft

    I never said to. And also do you get any errors in console?
     
  20. Offline

    pop4959

    PolarCraft Misunderstanding then, sorry! It seemed like that was a fix you were suggesting. I'm not getting any errors in the console when starting or stopping the server.


    Also, I take back what I said in my last post. The problem seems to be just as bad, as far as I can tell. What I measured must have been an exception. It still likes to stay at 1.5gb+ ram, even when absolutely no one is on. I'm now running the recent #2904 build (up-to-date as of this post).
     
  21. Offline

    Bobcat00

    Except that Mojang changed the way things are stored in 1.6.4. So much for "zero reason".
     
  22. Offline

    pop4959

    Bobcat00 Can you explain? I still don't really see any differences in "the way things are stored." Are you talking about how structures are now saved within the world file? I still don't see any other big changes according to the patch notes.
     
  23. Offline

    Bobcat00

  24. Offline

    pop4959

    Bobcat00 How that takes up more than 1GB more RAM is beyond me. Thanks, I guess. I'll mark this as solved, there's not really much else that can be done about it. I'll just hope Mojang optimizes this new storage technique or whatnot for 1.7.
     
  25. Offline

    Bobcat00

    I don't know. I'm just speculating that it could be (part of) the cause.

    I'm not seeing any memory problems. But I only have a handful of players on my server each day.
     
  26. Offline

    shadvalentine

    So .. I was also having a memory problem on my server .. I had 8gb of ram set and after a few hours it would be maxed .. it turns out that in my case I had a messed up spawn world ..

    I would recommend that you backup your worlds and try removing them 1 at a time and see if it fixes your memory leak.
     
  27. Offline

    Lagmonsta

    We have the same issue on our server and I am trying to nail down which plugin is causing it - or bukkit.

    Appreciate the efforts of people making bukkit - awesome standup job without you we would have no server. I will share with everyone what I have found don't know if it will help or not.

    Updated to 1.6.4 but along with it updated as many plugins as we could (current plugin count is 44), now some of these are unreleased so this is not doubt where my problem could be coming from. to me bukkit is in this mix (1 in 45 chance lol).

    I thought it was coreprotect too as we had recently switched over to this. Turns out it was not - went back to Logblock running SQLlite and the leak appears to still be there. What i did notice was the RAM does not appear to go up much when only 5ish people are online and could hover around this for days, but when we start to get around the 20 mark on weekends it really starts to climb. Which makes it really hard to find since I need 20 people to stay online while I put plugins in and out to find the one and wait the 30 mins for the RAM to start rising noticeably.

    And by rising I mean I could swear it has something to do with people interacting with the world - block breaking and placing (which is why I thought coreprotect was the problem). It does not rise and hold when people log in it just keeps on rising til we hit 6Gb and then lags like crazy

    Full load of plugins gets me to 3.36GB of RAM used, and we only allocate 6GB for the server which with 20 people online it gets to in about 2 hours.

    Pretty much stumped on how I can troubleshoot the problem without pissing off my entire community and them all bailing for another server. Best I can hope for is just to hang in there and swap in plugins every new release and hope the issue just stops one weekend.

    Again big thanks to bukkit people, and all plugin programmers that may read this - not bitching about you just trying to offer what little info I can since I have no knowledge of your technical wizardry. Never know maybe my rant is the missing piece of info you needed to find the problem, not that I see anything useful in this wall of text.

    TLDR; I have no idea
     
  28. Offline

    pop4959

    I also noticed that a new "world" world seems to fix this... I do not know why, though. I tested clearing the spawn of any and all tile entities, mobs, and heck, I even deleted all of the blocks and regenerated them. Rebooted the server right after that, and it still uses about 1.5 GB of RAM. Does anyone have any ideas?

    Lagmonsta Mojang changed how worlds are saved, and provided incompatibility with 1.7 in 1.6.4. My server, with a few more than 20 plugins uses about 1.5 GB of RAM (0 players online for testing) using my old map - but a freshly generated map uses 0.4-0.5 MB of RAM. If you are regularly using 3-4 GB of RAM with few players, you are definitely being afflicted worse than I am. Try creating a freshly generated map on your server and see how much RAM that takes up. It seems like only old maps waste this much RAM in 1.6.4. My server normally resets per 1.X, so 1.7 and a new map will fix this for me. I know that some server owners like to keep their maps for longer, however, which is why I am trying to search for some kind of fix here. Hope I helped you!
     
Thread Status:
Not open for further replies.

Share This Page