---
title: "OOMKilled and Exit Code 137: Why Kubernetes Kills Your Pods and How to Stop It"
url: https://daily.dev/posts/oomkilled-and-exit-code-137-why-kubernetes-kills-your-pods-and-how-to-stop-it-y4q54mlwx
source_url: https://cast.ai/blog/oomkilled-exit-code-137
type: article
source: "Cast AI"
published: 2026-06-26T07:39:00.376Z
updated: 2026-06-26T07:39:24.663Z
tags: ["kubernetes", "prometheus"]
reading_time: 10
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# OOMKilled and Exit Code 137: Why Kubernetes Kills Your Pods and How to Stop It

**[Cast AI](https://daily.dev/sources/castai)** · 10 min read · 0 upvotes · 0 comments

## Summary

OOMKilled (exit code 137) occurs when the Linux kernel's OOM killer terminates a container for exceeding its cgroup memory limit — Kubernetes only reports it, not enforces it. Three distinct scenarios produce OOMKilled: container limit breach, kubelet eviction under node memory pressure, and node-level kernel OOM. Diagnosis involves kubectl describe, previous container logs, and Prometheus queries using container_memory_working_set_bytes (not container_memory_usage_bytes, which includes reclaimable page cache). The correct fix is per-container rightsizing: set requests at p95 of working set over 7 days, limits at p99 or 1.5–2x requests. QoS class affects kill priority — Guaranteed pods are last to be killed. JVM containers need -Xmx capped at 75% of the container limit to account for off-heap allocation. At scale, automated rightsizing tools that track PSI metrics can proactively adjust limits before OOM kills occur.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://cast.ai/blog/oomkilled-exit-code-137>

## Similar posts on daily.dev

- [Kubernetes Exit Codes Explained: 137, 139, 143 and How to Fix Them](https://daily.dev/posts/kubernetes-exit-codes-explained-137-139-143-and-how-to-fix-them-k9fnz7rnp) · Cast AI · 0 upvotes · 0 comments

---

Tags: [#kubernetes](https://daily.dev/tags/kubernetes), [#prometheus](https://daily.dev/tags/prometheus)

[View this post on daily.dev](https://daily.dev/posts/oomkilled-and-exit-code-137-why-kubernetes-kills-your-pods-and-how-to-stop-it-y4q54mlwx)
