Error on installing minecraft

December 4, 2015 3.4k views
DigitalOcean DigitalOcean Articles

Hi guys! I tried to install minecraft and just run this command:

java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui

But I got this error:

OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000caf50000, 715849728, 0) failed; error='Cannot allocate memory' (errno=12)
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 715849728 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /root/minecraft/hs_err_pid6462.log

I followed this tutorial:

Can anybody help me?

2 Answers

What size droplet are you using. The two arguments you have in that command are minimum and maximum memory for the java process to use. If you are using less than a 2GB droplet you won’t have 1GB of available memory to allocate. Try either upgrading to a larger droplet or specifying a smaller memory allocation.

How can I specify a smaller memory allocation @ryanpq?

  • Use one of the following when launching the mc server.

    On a 512MB droplet
    java -Xmx256M -Xms256M -jar minecraft_server.jar nogui

    On a 1GB droplet.
    java -Xmx512M -Xms512M -jar minecraft_server.jar nogui

Have another answer? Share your knowledge.