Memory tuning guide

    It is recommended to configure total Flink memory ( or jobmanager.memory.flink.size) or its components for where you want to declare how much memory is given to Flink itself. Additionally, you can adjust JVM metaspace if it causes problems.

    The total Process memory is not relevant because JVM overhead is not controlled by Flink or the deployment environment, only physical resources of the executing machine matter in this case.

    It is recommended to configure (taskmanager.memory.process.size or ) for the containerized deployments (Kubernetes or ). It declares how much memory in total should be assigned to the Flink JVM process and corresponds to the size of the requested container.

    See also description of container memory exceeded failure.

    This is only relevant for TaskManagers.

    When running a stateless job or using the ), set managed memory to zero. This will ensure that the maximum amount of heap memory is allocated for user code on the JVM.

    RocksDB state backend

    The EmbeddedRocksDBStateBackend uses native memory. By default, RocksDB is set up to limit native memory allocation to the size of the . Therefore, it is important to reserve enough managed memory for your state. If you disable the default RocksDB memory control, TaskManagers can be killed in containerized deployments if RocksDB allocates memory above the limit of the requested container size (the total process memory). See also and state.backend.rocksdb.memory.managed.

    This is only relevant for TaskManagers.