Interview Prep/Kubernetes/Nodes, kubelet and container runtime

PyTorch training and headless-Chrome Pods crash with `Bus error (core dumped)` although memory limits are generous.

AdvancedTroubleshootingNodes, kubelet and container runtime
Answer

Likely causes → Containers get a 64 MiB /dev/shm by default. PyTorch DataLoader workers, Chrome/Puppeteer and Postgres parallel queries need more and fail with Bus error (SIGBUS) when it fills.

Diagnose →

kubectl exec train-x -- df -h /dev/shm

Fix → Mount a memory-backed emptyDir at /dev/shm:

volumes:
  - name: dshm
    emptyDir: {medium: Memory, sizeLimit: 2Gi}
volumeMounts:
  - {name: dshm, mountPath: /dev/shm}

This memory counts toward the container's memory limit, so raise it accordingly.

Prevent → Include the shm volume in your ML and browser-testing base charts.

All Kubernetes questions

More on Nodes, kubelet and container runtime