---
title: "Discussion on \"Why a Java pod gets OOMKilled in Kubernetes with a half-empty heap\" | Hashnode"
description: "Discussion on \"Why a Java pod gets OOMKilled in Kubernetes with a half-empty heap\". In short. A container memory limit covers everything the JVM uses, and the heap is only part of it. Metaspace, thread stacks, the code cache and direct buffers live outside the heap, so a pod with -Xm"
url: "https://hashnode.com/posts/why-a-java-pod-gets-oomkilled-in-kubernetes-with-a-half-empty-heap/6af3351518573de2479b867a"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Why a Java pod gets OOMKilled in Kubernetes with a half-empty heap](https://zhukovskyi.hashnode.dev/why-a-java-pod-gets-oomkilled-in-kubernetes-with-a-half-empty-heap?utm_source=hashnode&utm_medium=feed)

In short. A container memory limit covers everything the JVM uses, and the heap is only part of it. Metaspace, thread stacks, the code cache and direct buffers live outside the heap, so a pod with -Xm

1d ago · 6 min read · zhukovskyi.hashnode.dev  
Read the article

-   [#kubernetes](https://hashnode.com/tag/kubernetes)
-   [#java](https://hashnode.com/tag/java)
-   [#jvm](https://hashnode.com/tag/jvm)
-   [#devops](https://hashnode.com/tag/devops)

## Written by

[Andrii Zhukovskyi](https://hashnode.com/@zhukovskyi)

@zhukovskyi · Barcelona, Spain

  
[View profile](https://hashnode.com/@zhukovskyi)

Platform engineer: Kubernetes, AWS, AI tooling. I write about bugs I hit in production and the open-source tools I build.

Platform engineer working with Kubernetes, AWS and AI tooling. I write about production bugs and the open-source tools I build: jvm-fit, FileForge and Health OS. More at https://zhukovskyi.space

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
