Minecraft - How to Allocate More RAM/Memory
By default, Minecraft will use a maximum of 1 Gigabyte of RAM. Even if you have a high-powered gaming PC, with 32 or even 64GB at your disposal, Minecraft won't utilise those resources unless you allow it to do so. Put simply, it's a bit stupid.
So, how do you tell Minecraft it can use more than the standard 1GB of memory? It's easy: you open the Minecraft launcher, and change one number. Simple as that, and I'll walk you through each step, with screenshots and everything.
There are many reasons you may want Minecraft to have access to more RAM. For example:
- Better texture pack buffering (32/64/128x textures are beautiful but they're hard work for your computer)
- Improved map buffering (less reloading)
- Improved performance with RAM intensive mods (this is the most popular reason to add more RAM for Minecraft)
- Faster map rebuild
This tutorial will only work for Minecraft version 1.6 and above - the reason being that it is compatible with the "new" launcher with allows you to use Java commands. At the time of writing, the current version of Minecraft is 1.10 so there is no reason you should be playing a version lower than 1.6
This tutorial also requires that you've installed Java SE or Java Development Kit (JDK, includes SE) on your computer system. Installing the right Java version (and using the 32/64 bit version depending on you operating system) often solves many problems. See the Java website for more information on selecting the correct version, and remember to update regularly.
The error "Minecraft ran out of memory" happens often when running it with the wrong version of Java! The pre-installed Java on your computer may not be the correct version for Minecraft. If you don't have Java installed, get it here.
How to add more RAM
First, start the Minecraft launcher.
Second, in the Profile section at the bottom-left of the window, click edit profile. Your screen may look a little different from the screenshot if you have a newer version of the launcher. However, it will work just fine.
Third, under Java Settings (Advanced), tick the box marked JVM Arguments. The text box next to it will now no longer be grayed-out, allowing you to edit text in this field.
This text might look complex, but we're only concerned with 2 numbers, one at the start and one at the end.
-Xmx1G -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -Xmn128M
The first part "Xmx1G" tells Minecraft that it cannot use more than 1GB of memory(RAM) - this is the maximum amount of memory that can be allocated to the game. The last part is less important, but "Xmn128M" means that Minecraft will always be allocated at least 128 Megabytes of RAM i.e. one eighth of a gigabyte. Note that the minimum and maximum memory can be expressed as gigabytes of megabytes e.g. "Xmx1024M" is equal to "Xmx1G".
Now, to change the maximum amount of memory Minecraft can use, we simply change 1G to 2G. The line would now look like this:
-Xmx2G -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -Xmn128M
Minecraft can now use up to 2 gigabytes of RAM if it needs to. Click on save profile and launch Minecraft - you will always start with up to 2GB of memory available.
I want more!
I used 2 as an example, but if you want to allocate even more memory, you can use other numbers. The lines of code below allocate up to 3, 4, and 6GB of RAM respectively.
-Xmx3G -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -Xmn128M -Xmx4G -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -Xmn128M -Xmx6G -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -Xmn128M
Things to remember:
It should go without saying, but you can't allocate more RAM than you have. So if you have a computer with 4GB, don't try and allocate 6 gigabytes - all you'll get is an error message.
Also, remember that your computer needs RAM for other things too. If you go ahead and start up your computer, don't open any applications, and go to the Task Manager (Ctrl+Shift+Esc) and click on the Performance tab, you'll see that your computer uses about 1 or 2 gigabytes of RAM doing nothing. Well, not nothing; it's running the operating system and background programs like anti-virus software. Remember this when allocating RAM for Minecraft.
Troubleshooting
Something doesn't work?
- First of all check your spelling. Note: upper/lower case matters
- Check you've installed a the correct Java version
- Remove -Xms[RAM] and try again
- Adjust the numbers, try both at the same level, or change them back to the default
- Check if you have enough free RAM - are you trying to allocate more than you have?
- Do you use 64bit (when greater than 4GB)?
Thank you for reading!
I hope this tutorial was helpful to you. If you have any questions or feedback please feel free to leave a comment below.
Have fun, and watch out for Endermen!