Out of memoryjava.lang.OutOfMemoryError: Direct buffer memory
What it looks like in the log
java.lang.OutOfMemoryError: Direct buffer memory
How to fix it
- Update your rendering and shader mods—especially Iris, Oculus, Sodium, or Embeddium—to the latest build available for your Minecraft version, as older releases had direct buffer leaks when rendering entity shadows and overlays.
- Inspect your launcher's JVM arguments and remove any `-XX:MaxDirectMemorySize` flag so Java can manage direct memory automatically (or raise the value to at least `-XX:MaxDirectMemorySize=2G`).
- Check your RAM allocation (`-Xmx`) and ensure at least 2 to 4 GB of your computer's total physical RAM remains unallocated so your operating system and GPU drivers have room for off-heap buffers.
- Lower your shader Shadow Distance, reduce Render Distance, or remove high-resolution (256x+) resource packs if the crash happens in visually dense areas.
| Loaders | Fabric, Quilt, Forge, Neoforge, Vanilla |
|---|
| Severity | Stops the game |
|---|
| Category | Out of memory |
|---|
Check your own log