Strange error about ‘sh’ on Linux server

Discussion in 'Bukkit Help' started by xZise, May 16, 2011.

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

    xZise

    Hello,
    on “my” Linux server I'm getting following error with the builds 733, 740, 766 (none others tested):
    Code:
    java.io.IOException: Cannot run program "sh": java.io.IOException: error=12, Cannot allocate memory
            at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
            at java.lang.Runtime.exec(Runtime.java:593)
            at java.lang.Runtime.exec(Runtime.java:466)
            at jline.UnixTerminal.exec(UnixTerminal.java:297)
            at jline.UnixTerminal.exec(UnixTerminal.java:282)
            at jline.UnixTerminal.stty(UnixTerminal.java:273)
            at jline.UnixTerminal.initializeTerminal(UnixTerminal.java:77)
            at jline.Terminal.setupTerminal(Terminal.java:75)
            at jline.Terminal.getTerminal(Terminal.java:26)
            at jline.ConsoleReader.<init>(ConsoleReader.java:191)
            at jline.ConsoleReader.<init>(ConsoleReader.java:186)
            at jline.ConsoleReader.<init>(ConsoleReader.java:174)
            at net.minecraft.server.MinecraftServer.<init>(MinecraftServer.java:67)
            at net.minecraft.server.MinecraftServer.main(MinecraftServer.java:408)
            at org.bukkit.craftbukkit.Main.main(Main.java:87)
    Caused by: java.io.IOException: java.io.IOException: error=12, Cannot allocate memory
            at java.lang.UNIXProcess.<init>(UNIXProcess.java:148)
            at java.lang.ProcessImpl.start(ProcessImpl.java:65)
            at java.lang.ProcessBuilder.start(ProcessBuilder.java:453)
            ... 14 more
    
    Fabian
     
  2. Offline

    KakerZone

    Same is happening to me. Not sure if it's a Bukkit related problem, or RAM related problem...
     
  3. Offline

    AgentKid

  4. Offline

    xZise

    Code:
    #!/bin/bash
    screen -S minecraft java -Xms1024M -Xmx1024M -jar craftbukkit.jar nogui
    Linux:
    Code:
    Linux 87-98-243-15 2.6.24-11-pve #1 SMP PREEMPT Fri May 14 09:28:08 CEST 2010 i686 GNU/Linux
    Java:
    Code:
    java version "1.6.0_22"
    Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
    Java HotSpot(TM) Server VM (build 17.1-b03, mixed mode)
    What I recognized:
    Code:
    fabian@XXX-XXX-XXX-XXX:~/servers/766$ java -version
    Error occurred during initialization of VM
    Could not reserve enough space for object heap
    Could not create the Java virtual machine.
    Fabian
     
  5. Offline

    AgentKid

    Use top from command line, post the first 5 lines.
     
  6. Offline

    xZise

    And the second (failed) “java -version” command was executed while the server is running.

    top:
    Code:
    top - 14:32:29 up 302 days, 13:44,  2 users,  load average: 0.84, 0.39, 0.24
    Tasks:  21 total,   1 running,  20 sleeping,   0 stopped,   0 zombie
    Cpu(s):  8.6%us,  1.0%sy,  0.0%ni, 90.4%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
    Mem:   2097152k total,  1432616k used,   664536k free,        0k buffers
    Swap:        0k total,        0k used,        0k free,        0k cached
    Fabian
     
  7. Offline

    AgentKid

    664536k free means ~664 MB of RAM available to you. You're trying to start the server with 1GB, but you only have 664MB free. Try to find what's eating up all of your RAM (you have 2GB) and then try to start the server.
     
  8. Offline

    xZise

    Ehr the server is already running ;)

    Code:
    top - 16:04:14 up 302 days, 15:16,  3 users,  load average: 0.12, 0.21, 0.15
    Tasks:  22 total,   1 running,  21 sleeping,   0 stopped,   0 zombie
    Cpu(s):  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
    Mem:   2097152k total,   119840k used,  1977312k free,        0k buffers
    Swap:        0k total,        0k used,        0k free,        0k cached
    Without the server running.

    Fabian
     
  9. Offline

    TnT

    Try allocating more RAM - 1024 just doesn't seem to be enough with some of the plugins these days. Since you're x86, you're limited to 1536M, but try that.

    Code:
    #!/bin/bash
    screen -S minecraft java -Xincgc -Xmx1536M -jar craftbukkit.jar nogui
    Try with -Xincgc as well, should decrease your RAM usage, and hopefully let you run it again.
     
  10. Offline

    xZise

    Hmmm, it doesn't remove the error, and doesn't decrease the RAM usage:
    Code:
    top - 16:36:08 up 302 days, 15:48,  2 users,  load average: 0.35, 0.17, 0.12
    Tasks:  22 total,   1 running,  20 sleeping,   0 stopped,   1 zombie
    Cpu(s): 17.2%us,  0.3%sy,  0.0%ni, 82.5%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
    Mem:   2097152k total,  1929028k used,   168124k free,        0k buffers
    Swap:        0k total,        0k used,        0k free,        0k cached
    (Running 766 with TnT's commands)

    Fabian
     
  11. Offline

    TnT

    Here are things I would try:

    1. Remove all plugins - confirm it works. If it doesn't - go to step 3.
    2. If it works without plugins, put half back in - keep narrowing down until you find the plugin. Hint: Its likely one of the "big" plugins.
    3. Can you run x64 Java? Might be the only way to get around that.
     
  12. Offline

    xZise

    What do you mean with “works”? The error message at the beginning disappear? Nope, all plugins deactivated, and get still the same error message, and the ram usage is nearly high as before (only some MB difference).

    To your third point: Impossible, as it is a x86 Linux? (i686)

    Fabian
     
  13. Offline

    TnT

    Well, if you get stuck on #1 (yes, I mean you don't get that error), then you must go back to the Java you're using. Try either updating to 1.6.0_24/25 or going to 1.7.x. Not sure if it will help, but its worth a try.
     
  14. Offline

    xZise

    Okay and I get stuck ;) I have no permission to apt so I have wait until the server admin responds.

    But thanks for the help. Hopefully this will be solved soon :) Love the colors/features of the “sh” emulation.

    Fabian
     
  15. Offline

    TnT

    You can also try turning off jline for now, see if that helps.
     
  16. Offline

    xZise

    Okay after the server was updated today (both OS and CB) it is working now. \o/

    Fabian
     
Thread Status:
Not open for further replies.

Share This Page