How to Fix java.lang.InternalError
InternalError from an unsafe memory access means the JVM hit a memory fault while reading native or mapped memory. What causes it and how to track it down.
Quick Fix
Check the drive with the game or server files for errors and free space, keep the files off network and removable drives, and run the Java version the launcher provides.
Error Message
java.lang.InternalError: a fault occurred in an unsafe memory access operationHow to Fix
Make sure the drive with the game, world or server files has free space, and run a disk check on it.
Move the game or server off network and removable drives.
Reset CPU and RAM overclocks to default, and run a memory test such as MemTest86 if the crashes continue.
Use the Java runtime the launcher provides. Minecraft 26.2 runs on Java 25, where the message reads a fault occurred in an unsafe memory access operation.
On Java 8, used by Minecraft 1.16 and older, the same problem can read a fault occurred in a recent unsafe memory access operation in compiled Java code.
On a hosted server, ask the provider to check the storage, because the fault happens below the game.
Common Causes
- A memory-mapped file became unreadable while Java was using it, for example because the file was cut shorter or the drive under it failed. Java's documentation says access to such a truncated mapping fails with an unspecified exception.
- The storage device reported a read error during a direct memory access. Linux delivers this as SIGBUS and Windows as EXCEPTION_IN_PAGE_ERROR, and the JVM turns it into this InternalError.
- A network drive or removable drive disconnected while the game used files on it.
- Faulty RAM or an unstable overclock, which usually causes other random crashes as well.
Diagnostic Steps
- Check free space on the drive.
- Run a disk check.
- Move the files off network or removable drives.
- Test the RAM and remove overclocks if it continues.
FAQ
Does this mean my hardware is broken?
Not necessarily. A file that changed or became unreadable while it was mapped into memory causes the same error. If it keeps happening with healthy files, check the drive and the RAM.
What is unsafe memory access?
Java code can read and write memory directly through sun.misc.Unsafe and similar APIs, which libraries such as Netty and LWJGL use for speed. Minecraft 26.2 starts Java with --sun-misc-unsafe-memory-access=allow.
Why does the message differ between Java versions?
Java 8 used two texts, one of them ending in compiled Java code. Current versions such as Java 21 and Java 25 say a fault occurred in an unsafe memory access operation.
Related Errors
How to Fix World Corruption
Exception generating new chunk / Failed to load level.dat
How to Fix JVM Native Crash (hs_err_pid)
A fatal error has been detected by the Java Runtime Environment / hs_err_pidXXXXX.log
How to Fix OutOfMemoryError: Direct Buffer Memory
java.lang.OutOfMemoryError: Direct buffer memory