Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-118678

Minecraft gets stuck in a loop on memory use causing lag spikes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • None
    • Minecraft 1.12, Minecraft 1.12.1, Minecraft 1.12.2
    • None
    • Confirmed
    • (Unassigned)

      Just to rephrase this so it can be understood: In Minecraft this bug occurs in several ways (2 separate ways to duplicate this bug that adds lag spikes are shared below) and it makes itself force memory usage to go to 100% and more and then to remove memory usage it has a lag jitter taking it away but we get memory use still increasing and you have to reload the world to free up enough memory to stop the lag spikes.

      First off a Minecraft youtuber iJevin has evidence of this happening in a survival world, mine I deleted ages ago before finding this (21m 40s): https://youtu.be/laCZddsJxCY?t=1300
      I have had this happen with my worlds several times, unfortunately just ended making a new one and deleting the old world because there where no fixes and other people hadn't show they were getting this glitch yet (for where I checked at least).

      Essentially: Minecraft starts to stutter, every few seconds it freezes and then comes back for a few seconds then freezes.

      I have looked through everything and had several tests and couldn't find what it was until I did a Superflat world. For some reason Minecraft is taking an allocating memory for block removal even when it should be finished. Easiest way to reproduce this issue shown in the video:

      1. Start up Minecraft, new world, more world options, change "worldtype" to "superflat", "customise", "presets", replace preset with 3;12:1;1;, "create new world". (this can be the other sand type, I tested after)
      2. Open F3 so it shows memory on top right
      3. "/gamemode c", double tap spacebar to jump and stay in the air
      4. Memory should be going from 10% to 20% then back down
      5. Place a block to stand on so the sand falls away
      6. This will be lagging because of every block being updated, you will see it averages 30% and then drops back down when it is "complete"
      7. You will see with nothing being done for us it is slowly increasing with nothing being done, (you can make a walkway to the side, to make more block updates making this faster, the sand dropping speeds this up but it works without moving, but slower for it to start)
      8. Keeps going higher, 10:20%, 20:30%, 30:40%, eventually it goes past past 100% and this is the lagging glitch the we get

      It takes roughly 6 or 7 minutes on my PC.

      Yes this may be from the superflat world, may be from the slimes that fall at the start. Essentially blocks being removed from the game are making it end up having a lagging glitch where it keeps maximizing the memory being used until it spikes lag to fix it.
      My video proof (and I don't completely understand/know how I can make the video private, I will remove it when this is fixed): https://www.youtube.com/watch?v=kArvR1FAAgI (just an easy way to duplicate the glitch)
      Any tests are welcome, any worlds you have where this is happening could help as well, I initially thought it was just from world size (~250mb world) but found a way with no world files saved to bring it back.


      I also shared two or 3 extra additions:

      Sorry, it was just because of the size of the world that had it I deleted it ages before finding all this, I'm busy making a world that duplicates this. Busy doing it on a 1.12 new world and the glitch is repeating however it is slower (hence usually becoming a large world size by the time it starts coming up). Edit to add: the video I showed shows 1.12 on top left of F3, I wasn't sure so I double checked.

      Will take a few days for the world with only 1 falling block update to have it working to share, so first off making a world (and leaving it running) because it took roughly an hour to go from the 18% to 28% to increase and is now going 19% to 29% (so it shows it is slowly getting that glitch again) - will be leaving it for the day while I head to work. When I confirm this I will find a seed which has these falling blocks in the spawn area and share that.

      The domino effect lag happens at the start of the video but then goes away yet the memory use still keeps climbing, we aren't forcing chunks to load, I checked the save and the chunks outside that range aren't loaded or saved so if it is a domino effect there can be a fix for the lag spike by stopping things happening where the game isn't using chunks perhaps. The domino effect lag wasn't what this was for, at the end of the video as it gets stuck when looking around is the lag glitch, not the initial (immediate) lag from the domino effect.

      I will share this world when it brings back the glitch. Worldborder set to 100 blocks, peaceful mode, 1.12 random seed, to force a dropped block all I did was in creative mode created a stack of gravel and made it all fall and after all falling and becoming blocks I did the same pillar and made it fall and used a torch to automatically pick them up. It is slow to increase on this way of reproducing the exact same bug but this is what I will leave running till it brings the lag spikes so I can share how long this way of reproducing the bug takes (I just shared the other way since it takes a few minutes rather than a few hours).

      It might not just be the single/multiple moving blocks necessarily, I looked again (roughly 2.5 hours after the start) and it was at 24% -> 34%. Hence using normal generation that way isn't quick proof.

      Essentially block updates get stuck in a loop, I have an easy way to show this off. (1) Create new world in creative, pick a direction and travel that way (2) watch as the F3 menu shows the memory usage is climbing (3) when you have to lag glitch press escape in a gap in the lag and "Save and quit to title" (4) load the save and open F3 again (5) it shows roughly 80 to 90% memory (6) turn back and travel the way you came from.

      Takes roughly 1 or 2 minutes to bring the lag spikes back, takes roughly 20 seconds of travel (step 6 above) to make the lag spikes come back. Step 6 is going back the same path (more or less) to show chunk loading and less chunk generating.

      Closed Minecraft, restarted PC, opened Minecraft, opened world: F3 shows 63% (instead of roughly 10% starting a world shows). Moving anywhere increases it again to the 100% cap that holds the spikes.

      World is roughly 150 mb, with the worldborder world it showed it MIGHT also get the bug with no spots you can go to, however Im not waiting the weeks for that to show it gets to 100% I have a more guaranteed (fast) way.

      The actual post shows an easy way to duplicate but I worked out an easier way to duplicate (shared here). I see I slightly incorrectly described what "bug" this shares, but I have a way to show off how to get it with a normal world (also worked with normal survival play, was just a longer time to "run" the distance to cause this.

      It can be hardware/driver/java related but this is to try eventually find a way to work it off the game.

      I've read about a lot of it, its possible its hardware causing some of the issue. In a similar manner I've swapped from Windows 10 (latest update) to the latest Ubuntu (Linux) and even though my PC works better I can still duplicate the glitch (but its slower, I use the supposed same Java version install, it might be a bug from OS if it couldn't be replicated still). Its possibly where the Minecraft code is for most hardware but certain RAM sticks or hard drives cause this issue with minecraft (this is in programming boundaries since different operating systems require slight differences in code projects to work the same for example), its just clear that perhaps we should do more tests with different PCs since we can share our hardware and work out exactly what makes the bug happen in the MC code? It could be as simple as a bug for DDR 3 ram use in Java in a computer running the game causing the glitch...

      I can make video proof of bringing the lag spike glitch back if we need more (and the worlds, currently I removed them after the efforts).

            Unassigned Unassigned
            edg3 Ernest Loveland
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: