So with 8GB total RAM Minecraft uses 2.5GB directly after loading up a fresh process and world.
A few days later it has somehow gobbled up the 2.5GB that remains free on the system and Windows terminates the process.
This is new since 1.20.X, definetly 2 and maybe since 1... very recent.
Thank you for your report!
However, this issue is Invalid.
Simply stating that "My game is laggy" is not helpful for Mojang to diagnose your issue. If you can pinpoint a specific cause when lag happens for you, please open a new report for that specific issue. If you think this might be a hardware issue please contact Community Support as they might be able to help with your issue.
Keep in mind that Mojang is constantly optimizing the game and simply playing the game provides feedback to Mojang on which parts cause performance issues. To learn more about this, head here (section "Telemetry") for more information.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki