# Limit memory without pod being killed (OOM)

**URL:** <https://discourse.jupyter.org/t/limit-memory-without-pod-being-killed-oom/38367>\
**Category:** Zero to JupyterHub on Kubernetes\
**Created:** [January 28, 2026, 8:37am UTC](https://discourse.jupyter.org/t/limit-memory-without-pod-being-killed-oom/38367 "2026-01-28T08:37:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rdmnf](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/rdmnf/32/18935_2.png) [@rdmnf](https://discourse.jupyter.org/u/rdmnf)\
**Post date:** [January 28, 2026, 8:37am UTC](https://discourse.jupyter.org/t/limit-memory-without-pod-being-killed-oom/38367/1 "2026-01-28T08:37:47Z")

</div>

Hi, is there any way to limit the memory usage in Kubernetes JH deployment?

When the limit is passed the pod dies (OOM); is there any way to limit the memory usage, without the pod being killed?

---

<div class="post-metadata">

**Author:** ![Paul2708](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/paul2708/32/14207_2.png) [@Paul2708](https://discourse.jupyter.org/u/Paul2708)\
**Post date:** [January 28, 2026, 9:19am UTC](https://discourse.jupyter.org/t/limit-memory-without-pod-being-killed-oom/38367/2 "2026-01-28T09:19:28Z")

</div>

What kind of behaviour are you expecting if a user tries to claim more RAM than available?  
I don’t think it’s technically possible to realize it in general.

---

<div class="post-metadata">

**Author:** ![mahendrapaipuri](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/mahendrapaipuri/32/6800_2.png) [@mahendrapaipuri](https://discourse.jupyter.org/u/mahendrapaipuri)\
**Post date:** [January 28, 2026, 10:41am UTC](https://discourse.jupyter.org/t/limit-memory-without-pod-being-killed-oom/38367/3 "2026-01-28T10:41:54Z")

</div>

Maybe use [Pod Vertical Scaling](https://kubernetes.io/docs/tasks/configure-pod-container/resize-container-resources/) to increase memory limits at runtime to avoid killing the pod?

---

<div class="post-metadata">

**Author:** ![consideRatio](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/consideratio/32/1033_2.png) [@consideRatio](https://discourse.jupyter.org/u/consideRatio)\
**Post date:** [January 28, 2026, 4:59pm UTC](https://discourse.jupyter.org/t/limit-memory-without-pod-being-killed-oom/38367/4 "2026-01-28T16:59:03Z")

</div>

Do you think of user pods, or some other pod? Below I am assuming you think of user pods:

There are three kinds of memory kills worth distinguishing here:  
1: a containers non-init process is killed, like a jupyter kernel  
2: a containers init process is killed, the container will restart (k8s config dependent, but by default)  
3: the pod is evicted

You can avoid the third situation by guaranteeing the pod’s container memory equal to the memory limit.

You could avoid the second by constraining individual kernels memory somehow perhaps, if jupyter kernels are the typical sub-process that eat up memory. I’m not 100% confident this can be done with existing software, but i think maybe it can.
