I have been experiencing a lot of lag when I play with mods even with OptiFine. So, with my 24gb ram laptop which has intel graphics, I tried to increase the default 2gb of allocated ram. But no matter how much more ram I allocate to the game, it won't use more than 2gb of it in-game. I tried to use the optimized settings in the Intel graphics command center as shown below, but it says I have to run the game at least once. I have played the game so many times already!

Before someone says this is a duplicate question, yes I am aware that there is a similar question here: Why isn't Minecraft using the full amount of RAM? However, he uses Nvidia graphics, which is different than the Intel graphics that I have. Thus, any ideas how to force MC to use more ram in-game to decrease lag (or other ways to decrease lag)?

  • Excessively increasing RAM in Minecraft is completely counter-productive. Press F3 and watch the 'Mem:" entry in upper right corner. Java normally accumulates 'garbage' objects until it's close to filling up the memory allocated to it, then the process of garbage collection is kicked off and a big portion of the allocated RAM is freed up, usually in an unnoticeably short lag spike. The more RAM is to be freed up, the longer garbage collection takes - the period between garbage collections will be longer but each GC will take a noticeably long time, an actual, perceivable lag spike.
    – SF.
    Jan 15, 2021 at 21:12
  • 2
    why would your graphics card effect ram allocation?
    – Topcode
    Jan 15, 2021 at 21:46
  • Why would you force something to use more memory?
    – Penguin
    Jan 16, 2021 at 4:24
  • @SF. So you are saying allocating more ram is basically useless to decrease lag?
    – Subham
    Jan 16, 2021 at 4:30
  • @Subham A bit of extra RAM has a chance of decreasing certain kinds of lag. Plenty of RAM is completely counter-productive, introducing its own lag.
    – SF.
    Jan 16, 2021 at 12:25

4 Answers 4


The -Xmx 4G option simply determines the maximum amount of memory that Minecraft can use, it does not mean that Minecraft are forced to use that amount of memory.

If you want to force Minecraft to use that amount of memory, you should use -Xms instead of -Xmx. This is the option that forces Minecraft to use that amount of memory (actually, this is simply an option to let Minecraft reserve a specified amount of memory and use it from there when needed.)

It's important to note that -Xmx must have a value equal to or greater than the value set in -Xms. For example, if the -Xms value is 4G (-Xms 4G), then the -Xmx value must also be 4G or higher.

So, -Xms 4G -Xmx 4G or -Xms 4G -Xmx 8G.


There are other ways to reduce lag. such as turning Vsync off, changing the max framerate, and changing quality levels to fast. that works great, my proof is my lag went from 36 to 291 FPS.

  • This forum is a bit different than other, in one way being that you don't leave a signature. I've edited it out, but just a quick note for the future! Also, keep in mind a "max framerate" is what it sounds like. It's a cap. This shouldn't decrease or increase the FPS, it's literally just a cap.
    – Penguin
    Jan 16, 2021 at 4:28
  • Did you see significant improvement with modded Minecraft, or just vanilla?
    – Subham
    Jan 16, 2021 at 4:31

In case of this specific type of lag you've encountered - repeated periodic freezes of order of a second every couple seconds, occurring most frequently after a period of fast travel through the world (as opposed to spending time in one area), increasing the amount of memory allocated to Minecraft helps.

  • Open the launcher
  • pick 'installations' tab (above the pretty picture), you'll be brought to list of installations
  • click the installation you play (not any of the buttons on the right). You'll see a screen of "Edit installation"
  • click "More options" and scroll to the bottom.
  • In the 'Java Arguments' field, and change -Xmx2G to -Xmx6G

Garbage collection should be still reasonably fast, and the hiccups should stop.

  • I already wrote in my question that I tried that. I went in increments of 2gb all the way until even 20gb! There was no improvement whatsoever because mc always lags at around 2048 mb then goes back down, indicating it doesn't use that extra allocated space.
    – Subham
    Jan 22, 2021 at 21:23

I know this is really late but I have a potential solution. I was experiencing the same issue on vanilla and I was experimenting with different fixes. It may be a CPU problem naturally Java should use multiple processors. But mine was only about 2 or 3. If you go into task manager, right click (Open JDK platform binary) and go to details. Then right click javaw.exe and set affinity the click more processors or all processors and it helped with the lag spikes. I now experience no lag spikes whatsoever.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .