I can't allocate more RAM to Minecraft

I've looked at many different tutorials and Q&A websites, but I can't get it to work.
Right now Minecraft will only start if I have the -Xms1G
JVM argument; if I try to increase it, I get the error:
Error occurred during initialization of VM Could not reserve enough space for 2097152KB object heap.
It sounds like either I don't have enough RAM available, or there's a program keeping Minecraft from taking up that much RAM. However, I have 8GB of RAM, so I have way more than enough.
Does anyone have any ideas on what's keeping me from increasing the amount?
Best Answer
If you are going to use JVM arguments to define the memory allocation, be sure that you are not providing duplicate commands.
-Xms1G will set the MINIMUM HEAP to 1GB at start-up.
-Xmx1G will set the MAXIMUM HEAP to 1GB at start-up.
Generally, when I need more memory for Minecraft, I set the max heap and not the min heap.
For example;
java -Xmx2G -jar minecraft.jar
you could also set it like this:
java -Xms1G -Xmx2G -jar minecraft.jar
Avoid allocating too much RAM since that will starve the rest of the machine.
Pictures about "I can't allocate more RAM to Minecraft"



How do I force Minecraft to use more RAM?
Select "Minecraft." 3. Scroll down to "Java Settings" where you'll see "Allocated Memory" with a slider. From here, simply drag and drop the orange ball on the slider to your preferred RAM allocation.How do I enable 8GB of RAM for Minecraft?
Change the number in Xmx[number]G to the RAM you'd like to allocate. For example, if you have Xmx4G it means that you have 4 GB of RAM allocated to the game. Change it to Xmx8G if you'd like 8GB of RAM instead. Press the \u201cSave\u201d button and launch the game.Nas - I Can (Official HD Video)
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: cottonbro, Mnz, Valentine Tanasovich, Joan Costa