mojira.dev
MC-239474

Autosaving now causes extreme and gameplay-impacting lag

In 21w42a, whenever the world autosaves, there's a huge lag spike compared to auto-saving in 21w41a. This issue also causes legitimate gameplay issues, as mobs are able to attack the player some time before the world unfreezes, resulting in unfair deaths. I've noticed that it gets even laggier if you've mined some blocks and moved away from spawn as well.

Steps to reproduce:
1. Open a world.
2. Punch some trees and move away from spawn.
3. Wait for the autosave.
Expected behavior: The game will autosave as usual, with little to no lag.
What actually happens: The game freezes for a few second, and mobs can attack the player before the game unfreezes.

Linked issues

Attachments

Comments 16

We do not have enough information to find the cause of this issue.

While the lag occurs, please run /debug start, wait a while and then run /debug stop in order to create a debug profile. Afterwards, run /debug report.

If you do not have the permission to run these commands, open your world to LAN and enable cheats. If you're on a server, make sure that you're a server operator in order to execute these commands.

Then, please attach the profile results found in [minecraft/debug/profile-results-<DATE>.txt|https://minecrafthopper.net/help/finding-minecraft-data-folder/], as well as the debug report found in [minecraft/debug/debug-report-<DATE>.zip|https://minecrafthopper.net/help/finding-minecraft-data-folder/] here.

This issue is being temporarily closed as Awaiting Response. Once the requested information has been delivered, the report will be reopened automatically.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

I loaded a world with cheats. /debug start/stop are there, but there's no /debug report. On top of that, I can't run any commands during an autosave, because the game freezes. Either way,  there are still freezes from autosaving, which sometimes still result in unfair deaths and confusing gameplay.

 

[media]

Can confirm, that 9000ms server lag spike was during the autosave.

Can confirm, all entities freeze for me until the autosave is done

6 more comments

I have discovered something that may help. I was having this issue consistently then I modified the installation for 1.18 pre-1 in the launcher to change memory allocation from 2GB (default) to 16GB. I now no longer experience crashes or severe lag spikes (actually performance has improved dramatically). My machine has 64GB of RAM so I could easily spare it. While running the game it shows sometimes up to 55% memory usage (of the 16GB now allocated). This is effected also by view distance which I have set to 32 chunks currently.

That may be, but this release, 1.18 pre1, was totally unplayable for me until I increased the memory allocation from the default 2GB to 16GB. Before that it would choke badly at every autosave and nearly always crash while the autosave was in progress. I do not see how these issues are not related. Also this was a problem for save and exit as well. No form of saving the game did not lead to crash and burn. After increasing memory allocation I don't even experience lag on autosave.

It might be that this has always been happening, but it's just become super apparent now that the autosave has an indicator. Still something I think should be optimized though.

Fixed in new snapshots but still kinda laggy.

on Minecraft 1.20.4 

When more than 10K chunks are loaded, the autosave (every 5 min) maxes out nvme's for a couple of seconds and hangs ticks with the can't keep up warning (including vehicles rubber banding during the save)

Lunade Lunade

michael

Community Consensus

Very Important

Performance, Save Data

21w42a, 21w43a, 21w44a, 1.18 Pre-release 1, 1.18 Pre-release 4, 1.18 Pre-release 5

1.18 Pre-release 5

Retrieved