Allocate More RAM to Minecraft
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.
Contents
Steps
Using 1.6.X and Newer
- 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 installing more RAM. This is one of the easier computer upgrades to perform.
- 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 this guide 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 this guide.
- 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.
- Select your profile. Use the drop-down menu to select your profile. Click Edit Profile
- 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.
- Allocate more RAM. By default, Minecraft will allocate 1 GB of RAM for itself. You can increase this by typing -XmxTemplate:VarG. Replace Template:Var 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.
- Save your profile. Click Save Profile to save your settings.
- Run Minecraft. Start up your game. It will now be running with the new allocation of RAM you set.
- 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.
Using 1.5 and Older
- 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 installing more RAM. This is one of the easier computer upgrades to perform.
- 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 this guide 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 this guide.
- 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.
- 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.
- Enter in the code to allocate more RAM. Enter the following code into your text document:
- Change Template:Var 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.
- 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.
- 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.
- 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.
Using Minecraft Server
- 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 installing more RAM. This is one of the easier computer upgrades to perform.
- 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 this guide.
- Open your Minecraft server directory. This is the folder that contains the Minecraft_server.exe file that you launch to start your Minecraft server.
- 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.
- 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 -XmxTemplate:VarM -XmsTemplate:VarM -exe Minecraft_Server.exe -o true
PAUSE
OS X
#!/bin/bash
cd "$( dirname "$0" )"
java -XmsTemplate:VarM -XmxTemplate:VarM -exe Minecraft_Server.exe -o true
Linux
#!/bin/sh
BINDIR=$(dirname "$(readlink -fn "$0")")
cd "$BINDIR"
java -XmsTemplate:VarM -XmxTemplate:VarM -exe Minecraft_Server.exe -o true
- Change Template:Var 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.
- 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.
- 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
- Host a Minecraft Server
- Make a Minecraft Server for Your Friends and You
- Make Your Minecraft Server Not Lag
- Make Minecraft Run Faster