I investigated occasional quick "freezes" I would get in Minecraft about every 20 seconds or so - the fluid motion of me turning would stop and resume in less than probably half a second. It's barely noticeable but it frustrated me.

By opening up the F3/Debug screen I noticed the skip occurred whenever the memory value on the right-hand side would drop from, say, 25% down to 8%. From previous experience I believe this is the process of the program clearing out unused memory, the garbage-collection system in java, or something similar to that.

Is there any way to make this memory refresh system more smooth or make the quick lag spikes less frequent?

4 Answers 4


Possible solution:


You can download OptiFine here.

OptiFine is a great way of getting rid of lagg spikes, and has a lot of settings to adjust, and could possibly remove your lagg spikes, try to put everything off, or as low as possible, or just adjust it to your likings, also if you go to the setting called Other... you should see an option called Autosave, put it on 30m and it should happen less frequently.

Allocating more RAM to Minecraft

This one depends on the amount of RAM you have available, the more RAM you have, the better it runs, as Minecraft uses quite a lot of it, and allowing it to use more can make it run smoother.

Start the Minecraft Launcher and then go to Edit Profile. You should now see all the way down an option called JVM Arguments, enable it, and write the following: -Xmx2G -Xmn128M. If -Xmx or -Xmn is already in there, remove those. What this will do is allow Minecraft to allocate up to 2GB RAM to your Minecraft when you start it up, and it will always run with at least 128MB.

Of course this depends on how much RAM you have, if you only have 2GB RAM on your PC/Laptop then I strongly suggest you run it with -Xmx1G -Xmn64M And if you have more, I suggest you locate at least half of the RAM you have. Make sure that you don't locate all of your RAM to Minecraft, or other applications might not work anymore or freeze, they might even crash.

Note that in order to allocate more than 1.8G of RAM to Minecraft (or any java program) you require a 64-bit computer with 64-bit java. (The minimalist JRE that the more recent Windows versions of Minecraft install automatically will be 64 bit if your system supports it.)

Turn off all/some of your applications

When playing Minecraft, I strongly suggest you turn off most of, or all of your applications so it will run as smoothly as possible, because Minecraft isn't the only program that eats your RAM.

Increasing process priority

I recommend not doing this, but if your computer is really that bad, and you know what you're doing then you should continue reading this option.

When you're in your Task Manager, on Windows 8(.1) you should see all of your applications currently running, click on More details and then when you located Minecraft, right click it, and hover over to the option Go to details or something similar looking like that, and you should now see the java process highlighted, right click it, and hover over Priority or something similar looking, and click on the second highest option, as Realtime could crash your PC/Laptop or whatever OS you are using, you should be good to go now!

Note: The priority option could bring issues like some programs not responding/freezing so I recommend to keep Task Manager open to change this at anytime.

  • 2
    Optifine is probably a good idea of a solution, I'll test it out later. A note to others: to allocate more than 1.8G of RAM to Minecraft you require a 64-bit computer with 64-bit java. (The version on the java runtime environment download website that isn't x86) In fact to run any java program with that much RAM you require 64-bit. You will then also have to run Minecraft as an administrator: right click minecraft.exe... properties... compatibility... Run as an Administrator. Commented May 18, 2015 at 12:58
  • What @snickers10m said is correct, but I could have sworn you could only allocate 1GB of RAM with 32-bit Java? Commented May 18, 2015 at 14:41
  • According to stackoverflow.com/questions/1434779/… the actual max is 4G for java but varies from system to system. My machine permitted up to just under 2G for minecraft specifically. Commented May 18, 2015 at 16:09
  • @snickers10m did it work? :) Commented May 19, 2015 at 8:31
  • @snickers10m the little thing is: all 32bit processes shares the 4GB Limit on Windows due the construction of the Windows Kernel. So if you have a 32bit Chrome Running, it's RAM Usage must be taken into account if you try to run Minecraft with much RAM
    – Serverfrog
    Commented May 19, 2015 at 8:45

That's the Java garbage collector. You can add the following launch options:

-XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1

That should decrease the garbage collection lag dramatically by parallelizing garbage collection and decreasing the quantity and effect of collection events.

(taken from https://aikar.co/2018/07/02/tuning-the-jvm-g1gc-garbage-collector-flags-for-minecraft/)

You can also try running the latest 64-bit version of Java - newer versions of Minecraft now support Java 11+!

Finally, as the other responses said, Optifine (turn on the all options under Video Settings > Performance and increase the framerate to Unlimited) and performance enhancing mods (BetterFPS, FoamFix, Sodium/Phosphor/Lithium, etc.) can help a lot.


I had this problem for a while. I used optifine and had very frequent lag dump spikes. For some reason, on my 8GB ram PC, setting memory allocation to 3872MB fixed it. Somehow. IDK about your PC, maybe try 49% of your total ram? Hope this can help...

I'd recommend playing around with your memory allocation, one might remove the problem.

I also re-installed Java and my graphics driver, that helped as well.


It could be because of mods, because last time I use Minecraft with mods it doesn't lag,

Mods List: Optifine Just Enough Item Grappling Hook Mod

  • 1
    Hi Dyrroth, there is no mention of mods in the question, and there are a multitude of other possible reasons for lag. That Minecraft (with or without mods) doesn't lag for you is of no help whatsoever.
    – Joachim
    Commented Aug 23, 2019 at 18:20

You must log in to answer this question.

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