Open TLauncher and select the version of the game you want to play.
Select the gear icon on the right side of the version and choose Edit.
Under the JVM Arguments section, you will see a line that starts with -Xmx. This is where you can set the amount of RAM allocated to the game.
Change the value after -Xmx to the amount of RAM you want to allocate. For example, if you want to allocate 4GB of RAM, you would enter -Xmx4G.
Save your changes and launch the game.