While playing vanilla Minecraft 1.21.3 or 1.21.1 in single player, every 15-20 seconds or so theres a lag spike where the GPU goes from 25% with 50 fps to GPU at 1% with around 20 FPS for a second. The ram was increased to 7 gb and it helped a little but the problem still occurs regularly. Lag spikes occur more when loading chunks but still happen when not moving at all.
Impacts 1.21.3 and 1.21.1
Does not impact 1.16.5 and 1.20
Linked issues
Attachments
Comments

A few notes:
Does this occur in a specific world?
Turning your allocated RAM up past around 3-4GB often causes less stable FPS in vanilla Minecraft. Please try lowering it back down to that range.
Please provide a video of the lag occurring with F3 open when spikes/dips in FPS happen.
I'm most interested in what your RAM usage looks like during the FPS dips, as I suspect it may be related to garbage collection.

It happens in every world.
I changed the ram back to the default level.
Here is the video:
[media]Thank you for your report!
We're tracking this issue in MC-273262, so this ticket is being resolved and linked as a duplicate.
If you would like to add a vote and any extra information to the main ticket it would be appreciated.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
We do not have enough information to find the cause of this issue.
While the lag occurs, please press
F3
+L
once, then wait a short moment until profiling has finished.Afterwards, please attach the generated
.zip
file containing the profiling results here. The file path is shown in chat; the file can be found in[minecraft/debug/profiling/<DATE>.zip|https://minecrafthopper.net/help/finding-minecraft-data-folder/]
.If you are playing on a server please additionally run the command
/perf start
to create a profiling report for the server. In case you do not have the permission to run this command, make sure that you're a server operator.Once profiling has finished, please attach the generated
.zip
file fromdebug/profiling/<DATE>.zip
of the server folder.This issue is being temporarily resolved 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 (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki