One of the first and most often suggested fixes for the Minecraft Has Run Out of Memory error is to go into the Task Manager and change the priority of Minecraft, allocating more memory and processing power to the program.
Before we start, make sure you have other background programs such as iTunes, browsers and other games closed. If you are continually encountering the Out of Memory! error it is recommended that you always keep background programs closed. This will allow your computer to focus solely on Minecraft and not take up much needed RAM running anything else.
Now, to open the Task Manager simply press Ctrl + Alt + Esc on your keyboard (or Ctrl + Alt + Delete and then opening the Task Manager that way).
Then you should right click on minecraft.exe and press “Set Priority”. There are then several options ranging from Low to Realtime. To increase the performance of Minecraft we want to select either High or Realtime. Our team recommends just selecting High to ensure the stability of other background programs running on your computer.
This has the result of increasing the performance of and ultimately preventing Minecraft running out of memory in the future.
The below video has a step-by-step guide into how to change Minecraft’s memory priority on your PC.