Allocating RAM to Minecraft allows the game to load demanding texture packs.
Important: you can’t allow more memory than the amount present in your system
Launch optionsAdvanced settings and then open your profileJVM Arguments and replace everything with -Xmx4GNow replace the 4 with the amount of RAM you need.
For example: if you need 4GB, paste -Xmx4G. If you need 16GB, paste -Xmx16G.