To allocate more RAM to Minecraft, open the Minecraft Launcher > go to "Installations" > click the three dots on your chosen profile > "Edit" > "More Options" > under JVM Arguments, change -Xmx2G to your desired amount (e.g., -Xmx4G for 4GB). Save and launch.