Okay. Do this
Open Launcher>Click Launch Options>Click Advanced Settings>Click on the version you use>Click JVMArguments>Highlight the number that’s inside “Xmx1G”.
Changing that number will change the amountof gigabytes you use during that game mode.
Makes sure that you use version 1.12.1 because when using 1.12.2 with servers under it, it cancause an error accasionally.