Out of memory

java.lang.OutOfMemoryError: null (LWJGL Native Memory Exhausted)

What the log looks like

java\.lang\.OutOfMemoryError: null
java\.lang\.OutOfMemoryError: null[\s\S]{0,160}?org\.lwjgl\.system\.MemoryUtil\.nmemReallocChecked

How to fix it

  1. Lower—do not increase—the RAM allocated to Minecraft in your launcher (for example, 4 GB to 6 GB on a 16 GB PC) so your operating system retains enough free native RAM for Sodium, shaders, and GPU drivers.
  2. Restart your computer and close memory-heavy background apps (such as web browsers) to clear committed native memory.
  3. Open Windows Advanced System Settings > Performance > Virtual Memory and set the paging file to 'System managed size' on your main drive instead of disabling or capping it.
  4. Reduce Render Distance in Video Settings or temporarily disable heavy Iris shaderpacks to cut down off-heap chunk vertex buffer allocations.
  5. Remove Not Enough Crashes if installed, as it leaves rendering state corrupted after minor errors and triggers secondary memory crashes in Sodium and Iris.
LoadersFabric, Quilt, Forge, Neoforge, Vanilla
SeverityStops the game
CategoryOut of memory

Check your own log

Related errors