Solved Complex CraftBukkit server and Java problem! - "Could not reserve enough space for object heap"

Discussion in 'Bukkit Help' started by HPoltergeist, Jun 24, 2013.

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

    HPoltergeist

    Hi Guys!

    I was trying to raise the available memory for my Minecraft server and I have the usual...

    "
    Picked up _JAVA_OPTIONS: -Xmx2048M
    Error occurred 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 occurred. Program will exit.

    "

    ...error.

    I've searched for solutions and fixes on many places, there were many same or almost same answers, but none of them worked.
    So I post my problem here, to hopefully find a solution at last.

    What I've tried so far:

    - tried a bunch of command line parameters, like -Xincgc, -Xms2048M, -Xmx2048M, etc. (about 10 - 20 of them - from guides), but none of them worked
    - tried to set environment variables (java options and path), as you can see from my errors
    - tried 64bit Java JRE and JDK
    - tried different versions of CraftBukkit and Spigot
    - tried to set the page file to different values


    My hardware spec.:

    8 core CPU
    32GB RAM
    240GB SSD


    I'm using the latest 64bit Java, 64bit Win7 SP1.

    No values are working other than 1024M.
    So, if you have any serious, usable solution, please help me!


    Thank you very much, in advance,
    HPoltergeist
     
  2. your Xms value should be lower than your Xmx value. try -Xms512M
     
  3. Offline

    Bobcat00

    Post the command line you're using.

    My guess is you're using 32-bit Java, even though you've also installed 64-bit.
     
  4. Offline

    HPoltergeist


    I've also tried with lower Xms values than Xmx, like 1024 and 2048, or 2048 and 16384.
    None of them worked.

    HP


    I've already uninstalled all 32bit versions of Java and updates. I'll post my current command line later, from home.

    HP

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

    Bobcat00

    OK, but the error message is consistent with running 32-bit Java.

    The other thing to check is to go to My Computer - Properties and check the amount of RAM available.
     
  6. it could be that you dont have that much memory left to spare
     
  7. Offline

    Bobcat00

    Win7 should swap-out something to make room. Unless he has some other program with a memory leak eating up all his non-paged memory. (McAfee was doing that for a while.) There are some Task Manager screens to help find that.
     
  8. open a command prompt and type this
    Code:
    java -debug -version > "%userprofile%\desktop\javaDebug.log" 2>&1
    then paste the content of the resultant javaDebug.log file that appears on your desktop
     
  9. Offline

    HPoltergeist


    This is my whole batch file, including the command line (with some of my modifications):

    "
    @Echo OFF
    Color 16
    IF /I "%PROCESSOR_ARCHITECTURE:~-2%"=="64" "%ProgramFiles%\Java\JRE7\bin\java.exe" -Xincgc -Xms1024M -Xmx1024M -jar "%~dp0spigot-1.5.2-R1.1-SNAPSHOT.jar"
    IF /I "%PROCESSOR_ARCHITECTURE:~-2%"=="86" "%ProgramFiles%\Java\JRE7\bin\java.exe" -Xincgc -Xmx1024M -jar "%~dp0spigot-1.5.2-R1.1-SNAPSHOT.jar"
    PAUSE
    "

    (This is the actual command line, so substitute any higher value than 1024M and you get the error above.)

    I've also tried the plain command line too:

    "
    "%ProgramFiles%\Java\JRE7\bin\java.exe" -Xincgc -Xms1024M -Xmx1024M -jar "%~dp0spigot-1.5.2-R1.1-SNAPSHOT.jar"
    "

    (Spigot works almost the same way like Bukkit, so that isn't the problem - besides it's also not working with Bukkit.)

    I've attached a pic of the system properties.
    Server spec.JPG

    24GBs of RAM is free almost all times, no memory leaks, only necessary programs installed. Anti-virus is going fine. No McAfee.

    I've also double-checked Java versions, and uninstalled any 32bit installations.

    HP


    I have a total of 32GB RAM installed as I wrote and 24GB is free almost all times.

    And this is the output of the command line you suggested:

    "
    java version "1.7.0_25"
    Java(TM) SE Runtime Environment (build 1.7.0_25-b16)
    Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)
    "

    HP

    Up.

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

    HPoltergeist

    Up.

    Please read the whole thread to realize that I have 32GB RAM. I need useful answers, so please read through, then try to help.
    HP

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

    Bobcat00

    I'm out of ideas. There's obviously something wrong with your system, but you'll have to figure it out on your own. There's only so much we can do via a forum.

    One final shot. Try this in your command line (quotes are required):

    "C:\Program Files\Java\jre7\bin\java.exe" -Xms2048m -Xmx2048m

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

    HPoltergeist

    I have 3 servers, producing the same output.
    (8 core AMD, 32GB RAM, 240GB SSD | 8 core AMD, 8GB RAM, 120GB SSD | 4 core Intel, 8GB RAM, 120 GB SSD)
    I have no idea (searching for answers, for about a year or two) , that's why I came here for a solution. =/
    I'll try your command line.

    Thank you very much guys so far, if there are any further thoughts, they are very welcome! =)
    HP

    Up.


    It's working!
    Thank you very much!

    I've tried so many things, so the small ones causing that much problem!
    I'm sure it was because of a (automatically) poorly set environment variable...

    But it's working now. Like sunshine.

    Thank you again!

    HP

    Case solved.

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

    Bobcat00

    Glad we finally figured it out.
     
    HPoltergeist likes this.
  14. Offline

    Kaliber554

    Bobcat00 So if I type in that command, and it says that the system cannot find the path specified, then what should I do? This is my current pathing for java. (Note I'm trying to do a Minecraft server.) "C:\Program Files (x86)\Java\jre7\bin". I just don't include the java.exe. I have 16GB of Ram generally 12~14GB open. this is my batch file line. "@Echo off
    java -Xms2048M -Xmx2048M -jar minecraft_server.1.8.exe gui
    Pause"

    I retyped it into the command prompt as so, after changing my pathing to include java.exe ""C:\Program Files (x86)\Java\jre7\bin\java.exe" -Xms2048m -Xmx2048m" and it gave me the error message again D:

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

    Kaliber554

  16. Offline

    mischab1

    The Java that installs in Program Files (x86) is 32bit. If you don't have a copy of Java in C:\Program Files, then you probably don't have 64 bit Java installed. You can download it from Oracle at http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1880261.html
    I was getting the error when trying to run MinecraftLandGenerator on a Forge server. In that case, installing the latest 64 bit Java 7 and then updating Window's Path variable to include the path to the new Java, fixed the object heap error.
     
    1 person likes this.
Thread Status:
Not open for further replies.

Share This Page