Troubleshooting
OutOfMemoryError: Java heap space
The exception usually indicates that the JVM Heap is too small. You can try to increase the JVM Heap size by increasing . You can also directly increase task heap memory for TaskManagers or for JobManagers.
The exception usually indicates that the JVM direct memory limit is too small or that there is a direct memory leak. Check whether user code or other external dependencies use the JVM direct memory and that it is properly accounted for. You can try to increase its limit by adjusting direct off-heap memory. See also how to configure off-heap memory for TaskManagers, and the JVM arguments which Flink sets.
OutOfMemoryError: Metaspace
This is only relevant for TaskManagers.
The exception usually indicates that the size of the configured network memory is not big enough. You can try to increase the network memory by adjusting the following options:
Container Memory Exceeded
If a Flink container tries to allocate memory beyond its requested size (Yarn or Kubernetes), this usually indicates that Flink has not reserved enough native memory. You can observe this either by using an external monitoring system or from the error messages when a container gets killed by the deployment environment.
If RocksDBStateBackend is used:
- and memory controlling is disabled: You can try to increase the TaskManager’s .
- and memory controlling is enabled and non-heap memory increases during savepoint or full checkpoints: This may happen due to the memory allocator (see glibc bug). You can try to add the
MALLOC_ARENA_MAX=1
for TaskManagers.
Alternatively, you can increase the JVM Overhead.
See also .