Flink Container Killed by Kubernetes (OOMKilled)
Diagnose and fix Flink JobManager or TaskManager containers that exceed their memory limit and are killed by Kubernetes.
On this page
When a Flink JobManager or TaskManager container exceeds its memory limit, Kubernetes kills the container with the reason OOMKilled. Starting with Ververica Platform 3.1.6, the deployment's Events tab shows an event for each kill:
1TaskManager pod '<pod-name>' exceeded its memory limit (<memory-limit>) and was killed by Kubernetes (OOMKilled) at <time>. Consider increasing the TaskManager memory or the parallelism.The event names the pod, the memory limit of the container, and the time of the kill. For a JobManager container, the event names the JobManager pod.
The event appears once for each kill, also when the job recovers on its own, so a running deployment can still show that it's short of memory. On a deployment that ends in FAILED, the event appears next to the termination event and shows that the failure comes from memory, not from the job's own logic.
What to Do
Repeated events on one deployment mean that the configured memory doesn't fit the workload. Try these fixes in order:
- Increase the container memory. On the deployment's Configuration tab, in the Resources section, raise Task Manager Memory, or Job Manager Memory when the event names the JobManager pod. The memory limit in the event shows what the container had when Kubernetes killed it. See Modify.
- Increase the parallelism. Raise Parallelism in the same section. More TaskManagers share the workload, so each one needs less memory.
Evicting or deleting a pod doesn't produce this event. Only a container that exceeds its memory limit does.