Bukkit server - error occurred during initialization of vm

117 views
Skip to first unread message

Vicki Watson

unread,
Aug 18, 2015, 10:36:01 PM8/18/15
to Adventures in Minecraft Forum
I have a student who is receiving this error when she tries to start the bukkit server. How can she get this running? Would the canary server work instead?

error occurred during initialization of vm could not reserve enough space for 1048576KB object heap

Vicki Watson

unread,
Aug 18, 2015, 11:08:51 PM8/18/15
to Adventures in Minecraft Forum
start.bat in the bukkit folder has:
java -Xms1024M -Xmx1024M -jar craftbukkit.jar   

I assume that is what is starting the server? Is it possible to lower the 1024 to 512 or is that not enough memory to run it?

David Whale

unread,
Aug 19, 2015, 6:24:58 AM8/19/15
to Adventures in Minecraft Forum
Hi Vicki,

Here is an article that explains the two settings to the java command line:

We have found that Minecraft is a very memory hungry application, and reducing the memory while it might make the program run, might cause it to run very slowly or even crash. You could try it though to see if it is enough to do what you want with it. The canarymod server (I think) similarly suggests the same memory requirements (although Martin can probably confirm that for us as he uses it more than us)

However, it would be worth thinking through why your computer doesn't have enough virtual memory to allocate 1024MB of memory. Perhaps your computer is running too many other applications at the same time (you could close some down), perhaps it has suffered a memory leak from being on for a very long time (reboot it) or perhaps it has been configured with a fixed virtual memory size (in windows you normally let the OS manage this itself, but it might have been configured with a fixed swap file size for some reason).

Assuming you are running on windows.... On windows XP the rule always used to be to give the OS a swap file of 2.5 times the amount of real RAM that you have, and later versions of windows if they are using automatic swap file sizing will aim for about this figure. So, how much real RAM does your computer have? The swap file is what provides the memory for the virtual memory space (virtual memory is always bigger than real memory provided by RAM, it's a trick to make more memory available than you really have - RAM objects get swapped out to hard disk when not used regularly and this gives you the virtual feeling of having more memory, all be it slower due to the slower response times of the hard disk).

The swap file (virtual memory) is actually managed on the hard disk of the computer, so if your hard disk on your computer is nearly full, you will find that windows will not be able to extend the swap file to increase the amount of virtual memory, so clear some space out from the hard disk (delete temporary internet files, run the disk cleanup tool, etc etc).

I hope all these ideas help out. Please do report back with your findings on each of the experiments above.

David
@whaleygeek



Vicki Watson

unread,
Aug 19, 2015, 8:32:16 AM8/19/15
to Adventures in Minecraft Forum
The startbukkit.bat file has these lines:

cd Bukkit
start.exe

So it doesn't run the start.bat file in the bukkit folder? That's what appears to set the memory usage.

bukkit/start.bat
java -Xms1024M -Xmx1024M -jar craftbukkit.jar  

Just wondering if we run startbukkit.bat, what those settings are actually set to?

We're using your book in an online class for Landry Academy. I haven't heard back from that particular student yet. Asked her to reboot and run bukkit before running other programs to see what happens.

Thanks for the help!


Martin O'Hanlon

unread,
Aug 20, 2015, 5:33:47 AM8/20/15
to Adventures in Minecraft Forum
Hi Vicki,

In the windows downloadable starter kits I used Launch4J to create a launcher for Bukkit (start.exe), this is due to the java install on Windows not being consistent. Effectively start.exe runs java -Xms1024M -Xmx1024M -jar craftbukkit.jar  but it also does the complicated work of making sure java (or the right version of java) is installed, working out where it is installed and running it.

In usual circumstance start.bat isn't run, I left it in for testing circumstances, but it works, just double click it and it will start up Bukkit.

You might get an error saying some similar to "java - command not found", this is usually due to a path to java not being setup and is pretty typical if you have just installed the JRE (java runtime environment), in which case you will need to change the start.bat to include the full path to java i.e:

 c:\program files/ ...... /java -Xms1024M -Xmx1024M -jar craftbukkit.jar

So if you want to change the values of how java runs Bukkit, I would change start.bat and run it directly.

The 2 values Xms & Xmx are the amount of memory Java gives at the start (Xms) and the maximum amount of memory Java will give (Xmx).

If you are having memory issues you could reduce these to say 512M e.g.

java -Xms512M -Xmx512M -jar craftbukkit.jar

However, as David says, you might experience problems, Minecraft is a memory hungry application.

I hope this helps, if not give us a shout.

Martin

Vicki Watson

unread,
Aug 21, 2015, 10:44:38 AM8/21/15
to Adventures in Minecraft Forum
Okay, that particular student was able to switch to another computer and run bukkit successfully.

Thanks for your help. I hope they all have everything working now!
Reply all
Reply to author
Forward
0 new messages