Share via

How to fix random lag after playing minecraft for a while?

shadow kats 5 Reputation points
2026-03-20T02:12:38.01+00:00

I've been having an issue with minecraft. When I play Minecraft for a while, id say about a couple hours or sometimes maybe an hour my entire pc freezes for a second then im lagging super badly at 2 frames per second and it doesnt stop lagging till I restart it. I've looked for issues like my cpu or gpu overheating but I've seen nothing like that. I have a 5070, i5 14600kf and 32gb of ram. Im not too sure why that keeps happening, it's only with minecraft.

Windows for home | Windows 11 | Gaming
0 comments No comments

3 answers

Sort by: Most helpful
  1. Lucus-V 7,075 Reputation points Microsoft External Staff Moderator
    2026-03-31T19:00:02.85+00:00

    Hi shadow kats,

    Please check the Memory integrity status by opening Core isolation from Start Menu, you will see Memory integrity there.

    If Memory integrity is On, please turn it off then restart your computer.

    Does the problem persist after that?

    If you have any updates, please feel free to let me know.

    Was this answer helpful?


  2. Lester Bernard Reyes 79,530 Reputation points Independent Advisor
    2026-03-20T02:49:53.32+00:00

    Hi, I'm Bernard, a fellow Windows user. I'm happy to help!

    Can you please check the System logs on the PC so I can further examine the root cause of the issue?

     

    To share the System logs, please follow the steps in the link below:

     

    Press the Windows key + X, then select "Event Viewer"

    Click the drop-down of "Windows logs"

    Right-click System > click Filter Current logs > Check: Critical, Warning, and Error > Hit OK

    On the right pane, click "Save Filtered Log File As..."

    Save the System logs file to your desktop and share it by following the steps from the link:

    https://support.microsoft.com/en-us/office/share-onedrive-files-and-folders-9fcc2f7d-de0c-4cec-93b0-a82024800c07

     

    Note: You can also use your preferred cloud storage to upload and share the logs.

    Was this answer helpful?

    0 comments No comments

  3. Q&A Assist
    2026-03-20T02:13:04.94+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    The symptoms point to a performance or resource leak that builds up over time while Minecraft is running, eventually causing severe FPS drops and system stutter until restart. Focus on optimizing Minecraft’s resource usage and checking for Windows-side freeze issues.

    Try these steps:

    1. Use Minecraft’s FPS limiter and AFK limiter
    • In Minecraft video settings, enable the FPS limiter so the game is not running uncapped at all times.
    • If available in the version being used, turn on the “Reduce FPS when” feature and set it to:
      • Minimized: limit FPS when the window is minimized, or
      • AFK: limit FPS when there is no input for a while. This reduces sustained GPU/CPU load and power usage when not actively playing, which can help prevent long-session slowdowns.
    1. Reduce texture and pack load If using resource packs, shaders, or large modpacks:
    • Keep total texture count and size reasonable:
      • Stay well below the 4,000 texture-handle limit to avoid “pink textures” and instability.
      • Prefer 16×16 or 32×32 textures where possible.
    • Keep pack size and file count under recommended ranges:
      • World templates: under ~200 MB uncompressed and under ~10,000 files (5,000–7,000 safer).
      • Add-ons: under 25 MB uncompressed and under 2,500 files. Large or numerous textures and files can cause memory pressure and slowdowns over time, especially after playing for an hour or more.
    1. Optimize commands, scripts, and add-ons If the world uses behavior packs, scripts, or command-heavy maps:
    • Avoid running commands or scripts every tick. Instead, run them on intervals (for example, every 20 ticks) and stagger different systems so they don’t all run on the same tick.
    • Avoid large /fill or /clone operations in a single tick; split them into smaller operations over multiple ticks.
    • Reduce entity counts in farms or mob-heavy areas and simplify particle effects.
    • Clean up script data structures (arrays/maps) and event subscriptions so they don’t grow indefinitely. These changes prevent CPU load and memory usage from ramping up the longer the session runs.
    1. Profile Minecraft scripts (if using Bedrock scripting) If using JavaScript behavior packs on Bedrock:
    • Run the in-game profiler:
      • /script profiler start
      • Play normally until lag appears or for several minutes.
      • /script profiler stop
    • Open the generated .cpuprofile file in Visual Studio Code to see which functions consume the most time and optimize or throttle them.
    1. Check Windows for freeze-related issues Because the whole PC stutters when Minecraft lags:
    • When the system is in a frozen or nearly frozen state, try:
      • Remote desktop into the machine from another device.
      • Ping the PC from another device and check for packet loss or high latency.
      • Use tools like Computer Management or Server Manager to see if the system is responsive.
    • When the system has recovered after a restart:
      • Review System and Application event logs for errors or warnings around the time of the freeze.
      • Run perfmon /report to generate a System Diagnostics report and look for resource bottlenecks or driver issues. If freezes persist, consider collecting a memory dump during the freeze (for example, using CrashOnCtrlScroll or Hyper-V’s Debug-VM for VMs) and analyzing it for driver or kernel issues.

    If the lag only ever appears after long Minecraft sessions and disappears after reboot, the most likely fixes are: lowering texture/pack load, reducing script/command frequency, limiting FPS (especially when AFK or minimized), and identifying any misbehaving add-ons via the script profiler.


    References:

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.