Why does Minecraft say "ran out of memory" when I turn on shaders with Optimum Realism
Shaders plus a high-res pack push Minecraft past its default RAM. Allocate 6-8 GB in the launcher (-Xmx6G), keep it under half your system RAM, and close other apps. The pack itself doesn't cause the crash — the memory ceiling does.
High-res textures + shaders blow past the default
The launcher often defaults to just 2-4 GB. A 256x or 512x pack with a cinematic shader needs more — and Java's real memory footprint runs close to 2× the heap you allocate, so a machine giving Minecraft 4 GB really wants 8 GB+ of system RAM. When the heap fills, you get "ran out of memory" or "java.lang.OutOfMemoryError: Java heap space".
Give Minecraft more RAM
Open the launcher → Installations → hover your profile → Edit → More Options → JVM Arguments. Find -Xmx2G and change it to -Xmx6G (8 GB machine) or -Xmx8G (16 GB machine).
- 8 GB system RAM Allocate 4 GB (-Xmx4G)
- 16 GB system RAM Allocate 6-8 GB (-Xmx8G)
- 32 GB system RAM Allocate 8-10 GB
More is NOT better — over-allocating causes garbage-collection stutter. Never exceed half your total system RAM, and leave headroom for Windows.
Close memory-hungry apps
Chrome with many tabs, Discord, OBS, and other games eat the RAM Minecraft needs. Close them before launching — on an 8 GB machine this alone can be the difference between crashing and not.
Drop a resolution or shader tier if you still crash
If you're on 8 GB total and still hitting the wall, run 128x instead of 512x, or a lighter shader. The free 64x pack has identical coverage at a fraction of the memory cost.
Add FerriteCore to cut RAM use
On Iris + Fabric, FerriteCore reduces Minecraft's memory footprint by roughly 40% for free. Combined with Sodium it's the cleanest way to stretch a low-RAM machine.
Did this help?