Allocate More RAM to Minecraft

Revision as of 17:18, 24 June 2017 by Kipkis (Kipkis | contribs) (Text replacement - "<br><br>" to "")

If you're running into memory errors when playing Minecraft, you may be able to solve them by allocating more memory (RAM) to your Minecraft program. If you're playing a newer version of Minecraft, you can easily allocate RAM from the launcher. If you're using an older version, you will need to create a batch file that will launch Minecraft with more memory. If you're running a server, adding more memory can increase your server performance.

Steps

Using 1.6.X and Newer

  1. Check how much RAM you have available. Open your System window by pressing the Windows + Pause key. Check the amount of memory (RAM) installed in your system. This will let you know how much RAM you can allocate to Minecraft.
    • If you don't have much RAM to work with, you can consider Install-RAM. This is one of the easier computer upgrades to perform.
  2. Install the latest version of Java SE. This will ensure that you are able to increase the memory allocation for Minecraft, which runs on Java. See Install-Java for details on downloading and installing the latest version.
    • Make sure you download the correct version (32-bit or 64-bit) for your operating system. To find out if you are running 32-bit or 64-bit Windows, see Check-if-Windows-Is-32-Bits-or-64-Bits.
  3. Start the Minecraft launcher. In 1.6.X and newer, you can allocate more RAM directly from the Minecraft launcher. If you are using an older version, see the next section.
  4. Select your profile. Use the drop-down menu to select your profile. Click Edit Profile
  5. Enable JVM Arguments. In the "Java Settings (Advanced)" section, check the "JVM Arguments" box. This will you to enter commands to modify the Minecraft program.
  6. Allocate more RAM. By default, Minecraft will allocate 1 GB of RAM for itself. You can increase this by typing -XmxG. Replace with the number of gigabytes you want to allocate. For example, if you wanted to allocate 18 GB, you would type -Xmx18G.
    • Make sure to leave some RAM for your operating system. For example, if you have 20 GB of RAM installed, you should only assign up to 12 GB to Minecraft.
  7. Save your profile. Click Save Profile to save your settings.
  8. Run Minecraft. Start up your game. It will now be running with the new allocation of RAM you set.
  9. Check that your settings are working. While playing the game, press F3 to open the console. Look for the "Allocated memory:" message to see how much memory has been allocated to Minecraft.[1]

Using 1.5 and Older

  1. Check how much RAM you have available. Open your System window by pressing the Windows + Pause key. Check the amount of memory (RAM) installed in your system. This will let you know how much RAM you can allocate to Minecraft.
    • If you don't have much RAM to work with, you can consider Install-RAM. This is one of the easier computer upgrades to perform.
  2. Install the latest version of Java SE. This will ensure that you are able to increase the memory allocation for Minecraft, which runs on Java. See Install-Java for details on downloading and installing the latest version.
    • Make sure you download the correct version (32-bit or 64-bit) for your operating system. To find out if you are running 32-bit or 64-bit Windows, see Check-if-Windows-Is-32-Bits-or-64-Bits.
  3. Open your Minecraft game directory. This is the folder that contains the Minecraft.exe file that you launch to play Minecraft. This is usually not the same folder that contains the minecraft.jar file.
  4. Right-click and select New → Text Document. This will create a new text document in the same location as the minecraft.exe file. Name the file "Minecraft New Launcher" or something similar.
  5. Enter in the code to allocate more RAM. Enter the following code into your text document:
    • Change to the value in megabytes that you want to allocate. To allocate 2 GB, type 2048. To allocate 3 GB, type 3072. To allocate 4 GB, type 4096. To allocate 5 GB, type 5120.
  6. Save the file as a BAT file. Click File and select Save As.... Change the file extension from .TXT to .BAT.
    • If you cannot see the file extensions, see Show-File-Extensions-in-Windows to learn how to re-enable them.
  7. Run the new file to start Minecraft. The .BAT file you create will be the new launcher for your Minecraft game. Launching with the .BAT file will allocate the new amount of RAM to the game.
  8. Check that your settings are working. While playing the game, press F4 to open the console. Look for the "Allocated memory:" message to see how much memory has been allocated to Minecraft.[2]

Using Minecraft Server

  1. Check how much RAM you have available. Check the amount of memory (RAM) installed in your system. This will let you know how much RAM you can allocate to Minecraft. See Check-Computer-RAM for details on finding out how much RAM you have installed on your server.
    • If you don't have much RAM to work with, you can consider Install-RAM. This is one of the easier computer upgrades to perform.
  2. Check how many bits your operating system runs at. If you are running a 32-bit operating system, you can only allocate 1 GB of RAM to your server. If you are running a 64-bit operating system and have the 64-bit version of Java installed, the only limit is the amount of RAM you have physically installed. To find out if you are running 32-bit or 64-bit Windows, see Check-if-Windows-Is-32-Bits-or-64-Bits.
  3. Open your Minecraft server directory. This is the folder that contains the Minecraft_server.exe file that you launch to start your Minecraft server.
  4. Right-click and select New → Text Document. This will create a new text document in the same location as the minecraft_server.exe file. Name the file "Minecraft Server New Launcher" or something similar.
  5. Enter in the code to allocate more RAM. Enter the following code into your text document depending on the operating system you are using:
    Windows
     java -XmxM -XmsM -exe Minecraft_Server.exe -o true
     PAUSE


    OS X

     #!/bin/bash
     cd "$( dirname "$0" )"
     java -XmsM -XmxM -exe Minecraft_Server.exe -o true


    Linux

     #!/bin/sh
     BINDIR=$(dirname "$(readlink -fn "$0")")
     cd "$BINDIR"
     java -XmsM -XmxM -exe Minecraft_Server.exe -o true

    • Change to the value in megabytes that you want to allocate. To allocate 2 GB, type 2048. To allocate 3 GB, type 3072. To allocate 4 GB, type 4096. To allocate 5 GB, type 5120.
  6. Save the file. If you are using windows, save the file as a ".bat" file. Click File and select Save As.... Change the file extension from ".txt" to ".bat". If you are using OS X, save the file as a ".command" file. If you are running Linux, save the file as a ".sh" file.
    • If you cannot see the file extensions in Windows, see Show-File-Extensions-in-Windows to learn how to re-enable them.
  7. Run the new file to start Minecraft. The file you create will be the new launcher for your Minecraft server. Launching with the .bat, .command, or .sh file will allocate the new amount of RAM to the server.

Warnings

  • Be careful that you do not allocate more RAM than your computer has, or else you will get an error that the Java VM failed to start, and Minecraft will not run.

Related Articles

Sources and Citations