Minecraft Java can run out of memory quickly if you heavily mod the game. Here’s how to allocate more to boost performance.
https://www.digitaltrends.com/computing/how-to-allocate-more-ram-minecraft/
https://www.digitaltrends.com/computing/how-to-allocate-more-ram-minecraft/