Solved Ubuntu Server Has Invalid Heap Sizes

Discussion in 'Bukkit Help' started by OctopusPlaya, Mar 16, 2013.

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

    OctopusPlaya

    Hello everyone.

    I have installed Ubuntu Linux on my server to run my server 24-7. I have looked for about a good hour for an answer and none of them seemed to work. What my problem is, is that when I start my Craft Bukkit server it will just say invalid heap size and something about a virtual box. I have 8 GB or RAM in there and I'm setting it as 4096M. I don't know what I'm doing wrong here. Any help will be greatly appreciated. I'm running the last 1.4.7. Recommended Build with Java JRE 7.
     
  2. Offline

    rguz10

    Can you post your startup script?
     
  3. Offline

    OctopusPlaya

    Yes, thank you for replying. This is from my CraftBukkit.sh file

    " java -Xms1024M -Xmx7168M -jar craftbukkit.jar -o true"
     
  4. Offline

    rguz10

    Code:
    #!/bin/sh
    BINDIR=$(dirname "$(readlink -fn "$0")")
    cd "$BINDIR"
    java -Xms1024M -Xmx1024M -jar craftbukkit.jar -o true
    Try that. I think it will fix it but i'm not sure, let me know.
     
    OctopusPlaya likes this.
  5. Offline

    OctopusPlaya

    What you posted above works. I don't know, ever since I re-installed Ubuntu 12.10 I've been having this problem. I'm using Java 7 Runtime. It won't let me change the amount of RAM I can use. Below or beyond 1 GB (1024 MB).
     
  6. Offline

    Vox

    I am using Ubuntu and have the same amount of RAM. The server is basically dedicated to CB, so my startup line looks like this:

    Code:
    java -Xmx6144M -Xms4096M -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalPacing - XX:ParallelGCThreads=2 -XX:+AggressiveOpts -jar craftbukkit.jar nogui
    Copied this from ps.

    I have the server start at 4Gb heap and move to 6Gb heap.

    edit: read the last comment here: http://stackoverflow.com/questions/6585330/invalid-heap-size-where-it-is-taken-from

    It would appear that you might have a newline/space parsing issue with bash.
     
  7. Offline

    OctopusPlaya

    Thank you so much for replying. I tried that command, and even added it to my CraftBukkit.sh. This is what I get back.

    Invalid maximum heap size: -Xmx6144M
    The specified size exceeds the maximum representable size.
    Error: Could not create the Java Virtual Machine.
    Error: A fatal exception has occurred. Program will exit.
     
  8. Offline

    Vox

    Ahh, are you running the 64bit or the 32 bit version of Ubuntu?

    The 32 bit version can only have max heaps of 4Gb, IIRC. If you have an 8Gb machine, you REALLY ought to put the x64 version of Ubuntu server on it.

    Until then, change to -Xmx3072M -Xms2048M

    Also, keep in mind that the other opts on the java line are kinda specific to my machine. The concurrent GC and GC threads stuff is because I am using a dual core proc.
     
  9. Offline

    rguz10

    Sorry I just left. My Internet is down :( so from what I've read this happens when you use the 64x java
     
  10. Offline

    OctopusPlaya

    I just found out that my Ubuntu 12.10 installation is somehow 32-Bit when I selected 64-Bit. Could this have something to do with the problem?
     
  11. Offline

    Vox

    Yes. Since 32 bit operating systems won't let you address more than 4gb of RAM total, setting the max heap size to 6gb threw an error.

    Reinstall the OS to 64 bit and then use the startup params I gave you.
     
  12. Offline

    OctopusPlaya

    Thank you very much. After a few hours of figuring stuff out, I got Windows 7 64-Bit on here. I'll just use this temporarily so people don't think the server is gone forever. Thank you for the help from both of you.
     
Thread Status:
Not open for further replies.

Share This Page