Solved Server crashing when players join

Discussion in 'General Help' started by crafter407, Sep 12, 2015.

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

    crafter407

  2. Offline

    oceantheskatr

    The log is saying out of memory, so I'd like to know how much RAM you allocate to your server, and if you run it at home please post your run.bat.
     
    crafter407 likes this.
  3. Offline

    Boomer

    Its under a meg allocation, thats evident.
    And with that many plugins, and resource-heavy configurations as that (multiverse, multiple worlds) its not a surprise.
     
    crafter407 likes this.
  4. Offline

    crafter407

    @Echo off

    java -Xms1024M -Xmx1024M -XX:MaxPermSize=128M -jar spigot_server.jar
    pause

    I have 4GB of RAM in the PC hosting it but it would not allow me to allocate any more than this. However, my issue of it crashing when people join seems to only apply to a single player as I can join from a different location and it works perfectly with no lag
     
  5. Offline

    Boomer

    that indicates a map corruption, or chunks that have an insane amount of cpu-intense stuff going on - drops, waterflow/lavaflow, highfrequency redstone/piston activity; insane mob density in the region surrounding the player who gives the error

    Try reducing the server view radius to 4 and see if he can login, if that still crashes, change it to 2, and if it still crashes, then he was right on top of something causing the problem. Finding out if he knows anything about it (ie, he has the power to spawn things and spawned 10000 zombies just before it crashed him out, or was building a darkroom spawner and was standing in it waiting for the drops to reach 10000, or made a giant autofarm/harvesting system that just tried to flush thousands of crops at once, etc, etc, etc...) will also help in dealing with the issue

    If its a map corruption - which the errors do not really seem to suggest - you may need to scan the map for broken regions and have them removed, but try these other things first - if there are too many drops/chunks/etc, reducing the view radius will cut down on the amount of chunks to load and send to players, and the amount of drops/mobs to load in, etc, and give a chance for the system to flush out slowly overloads of drops, etc
     
    crafter407 likes this.
  6. Offline

    crafter407

    This problem as far as I can tell occured after dynmap took up all of the server space then crashed. I removed dynmap and deleted the corrupted usercache.json as instructed and it worked but the 2 players who had been on at the time appeared to both become affected. The first lost his inventory and contents of his enderchest and the second when he joins the server crashes. I will do what you said and check for map corruption and remove all unneeded drops and mobs but it is a whitelisted SMP server with about 10 players and i know all of them and none of them have access to spawning mobs and there are no large item farms on the server
     
  7. Offline

    Boomer

    Also, your statement you start it with 1gb ram is... contrary to the server log - the server log says "try using more memory - use this statement to start with 1gb" when it is below that.. And the fact that you say "I try to alocate more, but it doesnt work" ... it raises an eyebrow. All one needs to do is change the xmx setting. What happens when you try. Clearly you cant allocate like 3.5Gb to it, cause your computer is using resources, but you should be able to do 1.5 to 2.. what happens?

    Its also more interesting cause if making such change to the file results in no change.. is that even really launching the server, since you dont appear to be lauching with 1gb as it is
     
    crafter407 likes this.
  8. Offline

    crafter407

    When i attempt to launch with more RAM it gives me a java heap error and as far as i could tell when searching that it is because i cannot allocate that much. I may however of been trying to allocate it wrong. so if you could show me the correct start.bat for it that would be helpful (i can pretty much allow it all RAM cause all the PC does is hosts the server). Also, I am almost definite it is just that player now as 3 people (including me) are on the server and it is working fine. I am waiting for the other player to come online and to see if it still crashes when he joins, although my server does have a thing for messing up then starting working again for no apparent reason. Once I have updated the start.bat i will wait until the other player joins and leave this thread open. If he can join with no issues I will mark it as solved, if not i will come back to it. Thanks for the help on this btw
     
  9. Offline

    Boomer

    If you ran out of disk space, then yes, your map is likely corrupted. Players would lose inventory at the time because of the fact that when it is out of disk space, it can't save the contents of the game in memory back when it shuts down, and a save-all force would do nothing as well.

    Since corruption is a very strong possibility, you may need to look into the program called "RegionFixer" - its not a plugin, but a separate program/scripts that requires reading detailed instructions to run it. Just focus on the 'scan and delete corrupt chunks' part, rather than any 'try to surgically replace chunks from a backup version' and its not that difficult - but it does require a lot of reading and instruction following. And I also recommend using a copy of your map to scan first, and if it finds a couple bad chunks, then you replace those files. If it finds that there are 12000 bad chunks... then you're likely best just wiping the map and starting over, since doing that much work is like trying to give medical attention to a zombie hoping to bring it to normal

    "%ProgramFiles%\Java\jre7\bin\java.exe" -Xmx4000M -Xms1024M -jar craftbukkit-1.7.9-3096.jar
    thats a line from one of my bat files (I have 16Gb computer) used to launch old testservers that works.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 11, 2016
    crafter407 likes this.
  10. Offline

    crafter407

    I will check out region fixer and thanks for the .bat. Thankfully only one person lost their inventory as only 2 people were using it when the disk space ran out. I have since moved it to a drive with an additional 6-7GB so it should be fine but I will keep an eye on it more now

    It is still refusing to allow me to allocate any RAM above 1024 and I get

    Error occured during initialization of VM
    Could not reserve enough space for object heap
    Error: Could not create the Java Virtual Machine
    Error: A fatal exception has occured. Program will now exit

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

    Boomer

    open a command line and type
    java -version

    What is that output? And give an example of "any amount"

    I'd hazard a bet that you are only using a 32 bit java version to launch the server; 32bit cant access over 3gb of memory period, even on a 128gb machine, and on smaller memory machines, its likely not able to find a contiguous amount of memory to get the required amount from your computer. So if thats the case, actually getting and installing and using the 64 bit java will work better - and make your server operate better.

    You can also reduce the xms size to 192m so that it can try to find the memory in smaller fragments
     
    Last edited: Sep 13, 2015
    crafter407 likes this.
  12. Offline

    crafter407

    java version "1.7.0_55"
    Java(TM) SE Runtime Enviroment (build 1.7.0_55-b14)
    Java HotSpot(TM) Client VM (build 24.55-b03, mixed mode, sharing)
     
  13. Offline

    Boomer

    yeah, thats only the 32 bit build
     
    crafter407 likes this.
  14. Offline

    crafter407

    I have tried allocating "2048", "3072" and "4000" and they all give me the same error.

    I will install 64 bit java then. I am so stupid...

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

    Boomer

    3 and 4 wouldn't have worked at all clearly, 2 would only work in extreme circumstances, 1.25 might have worked on a 32 java as is, and 1.75 with a small xms only :)
    Good luck
     
    crafter407 likes this.
  16. Offline

    crafter407

    It now allows me to add the right amount of RAM. Thank you!

    Gonna leave this for now until i know if it still crashes when the player joins and reply again then
     
  17. Offline

    oceantheskatr

    If you have Essentials you can see their last login location. If you'd like to fix their crashing problem, then you can go to your main world's folder, click playerdata, find their uuid.dat file, and delete it. You can find a player's uuid at http://mcuuid.com/
     
  18. Offline

    Boomer

    If they were the players that were online when his system ran out of diskspace, then its not likely that his essentials file would have their coordinates as it wouldn't have been able to save the data, and if its crashing while they are logging in, it may not be info handed to essentials yet. However, his log will when a player trys to login, show both the uuid and world and coordinates it is trying to render them (from the system uuid.dat - which may also be corrupted at worse, and incorrect from where they last were at best) Crash logs will also show coordinates of players at the moment of a crash.
     
  19. Offline

    crafter407

    Server no longer crashes when the player joins. Problem is fixed.

    Thanks @Boomer and @oceantheskatr for the help

    :)
     
    oceantheskatr likes this.
Thread Status:
Not open for further replies.

Share This Page