( Note that the memory limit is set at the container level and not at the pod level )
In most CRI Implementations, Kubernetes only sets the cgroups and it is the job of the OS ( OOM killer ) to kill the process if it exceeds the memory limit.
Also note that if the main process has forked and created multiple processes inside the container, ( Or if you are exec ing inside the container using kubectl ) , OS will not kill all processes within the group. Instead, OS will decide ( using oom score ) on a single process to kill first. If this process is not the PID 1 , then the container will not restart. ( So, if you use a third party program like stress-ng - which forks multiple times - in order to stress test the application, make sure you pay attention to teh logs )