Out of memoryOutOfMemoryError: Cannot Reserve Bytes of Direct Buffer Memory
What it looks like in the log
java.lang.OutOfMemoryError: Cannot reserve <so> bytes of direct buffer memory (allocated: <so>, limit: <so>)
How to fix it
- Inspect your launcher's JVM arguments and delete any -XX:MaxDirectMemorySize=... parameter if one was added by a custom optimization argument list.
- Increase your allocated RAM (-Xmx) in your launcher profile from 2G to 4G or 6G (leaving at least 4 GB of physical system RAM free for Windows and off-heap buffers), since Java raises the default direct buffer limit alongside -Xmx.
- Update rendering and shader mods such as Sodium, Iris, Embeddium, or Oculus to their latest official releases, and replace old bundled forks (like legacy custom Sodium+Iris builds) that suffer from vertex buffer leaks.
- Lower Render Distance, turn off shaders temporarily, or disable high-resolution (128x and above) resource packs to reduce off-heap geometry and texture buffer allocations.
| Loaders | Vanilla, Fabric, Quilt, Forge, Neoforge |
|---|
| Severity | Stops the game |
|---|
| Category | Out of memory |
|---|
Check your own log