Allocating RAM in Minecraft Java Edition is quite simple. Open the game launcher, then go to the “Installations” tab and go to the options of the version you want to launch. There select “More Options” and in JVM Arguments there is a line like -Xmx2G. Here “2G” means 2 GB RAM. You can change this and write 4G, 6G or as much RAM as you want to give — just ensure that that much RAM is available in your PC. When you launch the game after saving the changes, it will run with the updated RAM.