java.lang.OutOfMemoryError

Discussion in 'Bukkit Help' started by Joxiscraft, May 16, 2012.

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

    Joxiscraft

    This error appears very random. When I run my server (craftbukkit 1.2.5-R1.0) without plugins I don't get this error. But when I run my server and add plugins one by one the error comes with every plugin. (sometime it comes when I only have 3 plugins on it... sometimes with 20 plugins without those 3)

    I have a server from enchantedhosting. There they also don't know what's causing the error and how to fix it. I have 1.5GB RAM and 24 plugins: Orebfuscator, WorldBorder, GroupManager, WorldEdit, NoCheatPlus, Permissions, Vault, TimedMessages, LWC, mcMMO, TreeAssist, WorldGuard, Essentials, EssentialsProtect, SimpleSignEdit, CreativeControl, EssentialsSpawn, HawkEye, Scavenger, BetterShop, ChestShop, EssentialsChat, RegionSelfService, Factions

    This is the error:
    16.05 17:40:08 [Server] SEVERE at java.lang.Thread.run(Thread.java:679)
    16.05 17:40:08 [Server] SEVERE at org.bukkit.craftbukkit.scheduler.CraftScheduler.run(CraftScheduler.java:61)
    16.05 17:40:08 [Server] SEVERE at org.bukkit.craftbukkit.scheduler.CraftScheduler.processTask(CraftScheduler.java:104)
    16.05 17:40:08 [Server] SEVERE at org.bukkit.craftbukkit.scheduler.CraftThreadManager.executeTask(CraftThreadManager.java:14)
    16.05 17:40:08 [Server] SEVERE at org.bukkit.craftbukkit.scheduler.CraftWorker.<init>(CraftWorker.java:28)
    16.05 17:40:08 [Server] SEVERE at java.lang.Thread.start(Thread.java:657)
    16.05 17:40:08 [Server] SEVERE at java.lang.Thread.start0(Native Method)
    16.05 17:40:08 [Server] SEVERE java.lang.OutOfMemoryError: unable to create new native thread
    16.05 17:40:08 [Server] SEVERE Exception in thread "Thread-4"

    At enchantedhosting they say I have enough memory.

    I have been looking on the internet for a long time and I haven't found a way to fix this.

    Please help me!
     
  2. Offline

    Sayshal

    Too many plugins or too little ram. It's crashing because it's out of memory, aka, your plugins are lagging the server to crash.
     
  3. Offline

    Joxiscraft

    No. The error even appears with only 3 plugins. I have enough RAM.

    That is not the problem

    That is not the problem

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

    Sayshal

    Yes, this is the problem.
     
  5. Offline

    Joxiscraft

    I know it says that. Like I already said: The error even appears with only 3 plugins (essentials, worldedit, groupmanager).

    I also thought the server was out of memory. I told the hosting company and they said that is not the problem.
     
  6. Offline

    gnftoxic

    Hi Joxiscraft,

    Could you post more out of your server.log file? This can help determine what is actually causing the memory exhaustion on your server.

    Regards,
    Bill
     
  7. Offline

    Sayshal

    Then your hosting company made a mistake. This error can happen even with 0 plugins. You have 1.5 GB of RAM for this server, when you do too many things (walk around to a farther area, drop items, go cave exploring etc) it uses more RAM. When that RAM gets about what you've been capped, you get "Out of Memory". But yes, maybe we can help you find out which plugin is causing this as gnftoxic suggests.
     
  8. Offline

    Joxiscraft

    http://pastebin.com/z18ynQ12

    This is my server log of today. (I was experimenting again, deleting/adding plugins)
     
  9. Offline

    gnftoxic

    Or, something I commonly see in my own company, someone placed/worldeditted probably around 5000-2000 TNT and set it off - which, without the proper optimization and a good amount of RAM, the server will throw a memory exception. I'm guessing that's probably what has happened here.
     
  10. Offline

    Sayshal

    Possible, but if he has limits like every server should he'd be fine.
     
  11. Offline

    Joxiscraft

    I will talk with the hosting company again.

    It's not just 1 plugin that causes the error. The error comes with almost every plugin setup.

    I just think it's weird that the server has run out of memory... I have worldboarder so people can't go to far and the error appears when nobody is online

    I never made big things with worldedit. I only have the server for 2 weeks now and The biggest thing I did was copying a small house.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 25, 2016
  12. Offline

    Sayshal

    1.5 GB Ram is really low my friend. I have 40 plugins and I use 10 GB of ram to handle that + the players.
     
  13. Offline

    Joxiscraft

    I know it's not much but it should be enough... I runned a server on my pc with 20+ plugins and 1GB RAM defined in the run.bat and there never was lagg. I also asked the hosting compnay if 1.5GB RAM is enough for my needs and they said it should be enough... but again. They can be wrong ofc
     
  14. Offline

    gnftoxic

    Are you able to get in game for even a slight second? Another cause could be too many drops on the ground, which if you have too many, it will cause your server to crash almost instantly. As Sayshal stated, with proper limitations, this shouldn't happen, but it's always a possibility.
    If you are able to get in the server, I would recommend using WorldEdit and doing something like '//remove drops 90000' to clear drops in a fairly large radius. This will not lag the server or cause any problems other than remove all item drops within the 90,000 block radius.
    Edit: Do note that this is an unlikely case, but I'm thinking of the more probable causes of the issues at hand.
     
  15. Offline

    Sayshal

    Also as you stated, can we get that server.log file?
     
  16. Offline

    gnftoxic

    Here's the log file, he posted it in an earlier post: http://pastebin.com/z18ynQ12
    It's newest to oldest, Multicraft format. I don't see anything from plugins in it, or anything at all, other than the memory exception, which leads me to believe that it may be the drops, or maybe there's something wrong with his region files. Nothing a pass through MCEdit can't fix.
     
  17. Offline

    Joxiscraft

    Me and my friends can still join the server after the error and we can walk around normal. The only problem we have is that after the error some plugins start to malfunction. and there are no drops

    What can I do with MCEdit?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 25, 2016
  18. Offline

    gnftoxic

    I'm amazed you can do anything after the error occurs, as it should technically render all actions on your server useless after that point.
    A few more suggestions:
    1. Run the server as a plain vanilla server, see if the memory error occurs. If so, run your world through MCEdit
    2. Upgrade to a newer version of CraftBukkit, if your host allows you to use a custom JAR, or ask them to setup use for CraftBukkit-B1.3

    If as a plain vanilla server the error still occurs, the only relation I can think of is your world being corrupt, even ever so slightly, which could cause the memory error...but that's a stretch.

    Simply open it with MCEdit. It removes/repairs chunks that are either corrupt or located at the wrong chunk. It's a common fix for things like this. Of course, make sure to make a backup of your world before doing this.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 25, 2016
  19. Offline

    Joxiscraft

    I will try to run the server vanilla. When I run the server (craftbukkit) without plugin I don't get the error (or I just don't wait long enough)
    Me and the hosting company already switched the craftbukkit.jar a couple of times from dev builds to recommended builds.

    I opened the world with MCEdit and I still have the error when I run my server :(

    Nothing helped :(

    Someone please help me...

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 25, 2016
  20. Offline

    Paswaru

    Can you see/modify the command line being used to launch your server? If so can you post it. I've got a feeling you have the -Xss set to something strange.
     
  21. Offline

    Joxiscraft

    I have a server from enchantedhosting... I don't have acces to that file but I will ask them about it

    I will try to acces it

    I tried to run the server with all my plugins and a new world (didn't walk in it so not much generated) and the erro still came after I started the server.

    Anyone?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 25, 2016
  22. Offline

    Rjames426

    I too get this error occasionally (after about 6-8 hours of up time), the error is caused by plugins and loaded chunks (as noted above), since I do not have extra ram to spare I config-ed my server to automatically STOP and then START every 4 hours OR any time there is a SEVERE error, which means anytime the server runs out of memory (SEVERE java.lang.OutOfMemoryError) the server will restart automatically.
     
  23. Offline

    Joxiscraft

    How do you do that?

    So getting 2gb RAM should fix this?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 25, 2016
  24. Offline

    Rjames426

    Using this plugin. And getting more ram will help but you still may have this error occasionally, I would suggest losing some plugins you don't need.
     
  25. Offline

    Joxiscraft

    I even have the error with only 3 plugins.
     
  26. Offline

    Rjames426

    Then your system must be a resource hog.
     
  27. Offline

    Joxiscraft

    When I remove 10 of my 24 plugins the error comes later... I don't know if that means something
     
  28. Offline

    Lolmewn

    What's your servers start script? How do you start it? (most commonly, start.sh or start.bat)
     
  29. Offline

    Joxiscraft

    I don't have acces to it but I will ask my hosting compnay about it
     
  30. Offline

    Rjames426

    What hosting company is this? Lol I would dropping them in a second!
     
Thread Status:
Not open for further replies.

Share This Page