Skip to main content
criticalJava ErrorsAffects: All versions

How to Fix OutOfMemoryError: Direct Buffer Memory

Fix Direct Buffer Memory error by increasing MaxDirectMemorySize JVM flag.

Quick Fix

Add -XX:MaxDirectMemorySize=512m to JVM arguments.

Error Message

java.lang.OutOfMemoryError: Direct buffer memory

How to Fix

1

Add -XX:MaxDirectMemorySize=512m to JVM arguments

2

Update networking or rendering mods

3

Reduce connected player count on servers

Common Causes

  • Networking or rendering using too much off-heap memory
  • Mod leaking direct buffers
  • Default direct memory limit too low

Diagnostic Steps

  1. Add the MaxDirectMemorySize flag
  2. Restart
  3. Monitor if the issue recurs

FAQ

What is direct buffer memory?

Memory allocated outside the Java heap for I/O operations. Networking and rendering use it heavily.

Related Errors

Need More Help?