Minecraft – Allocating more RAM for minecraft (Other methods were already tried)

minecraft-java-editiontechnical-issues

I have been trying for ages to get my minecraft to use more RAM, but it refuses to allocate more than 20% ram on my 4G computer. I want to allocate 2G, so the first method I tried was to type this into the JVM Arguments box in the edit profile option in the new launcher. This is what everyone told me to type in:

-Xms2048 -Xmx2048

Unfortunately after typing this in, saving my profile, and running minecraft, I get a window that pops up that says: there was an error in the Java Virtual Machine. Is there anyway I can get minecraft to allocate more RAM? I also tried going to Java and changing the settings there, but it still didn't work.

Best Answer

These numbers are in bytes, add M at the end to make them megabytes.

Contrary to the popular belief, more is not always better. As always with performance optimizations you should measure first, understand the problem, and then increase JVM memory only if that is indeed the problem (and then measure yet again to check if that fixed anything). For example, look at the "Used Memory: xx%" at the top right of the F3 screen. Normal behavior is it increases for a few seconds and then drops sharply and then starts to increase again and so on. If the minimum is hovering above 75%, or the maximum consistently hits 90%+, then Java memory might be a problem.