JVM Memory Map: Why Your Heap-Limited Spring Boot App Gets OOM-Killed (Exit 137)

Published: 19 July 2026
on channel: Visual Computer Science
211
8

You set -Xmx256m. Your container has a 512 MB limit. The kernel still SIGKILLs your Spring Boot app — exit code 137, no OutOfMemoryError, no heap dump. This video maps the memory the OS actually sees when it looks at a JVM: anonymous pages holding a whole memory economy the kernel can't read — and exactly why capping the heap doesn't protect you.

What you'll learn:
• What cat /proc/pid/maps shows for a running JVM — and why the OS has never seen a single one of your objects
• RSS vs virtual memory: reservation is nearly free, only touched pages count — and RSS is the only number the OOM killer cares about
• The heap is one tenant: thread stacks (~1 MB × 200 threads), Metaspace (10,000+ classes in a Spring Boot app), the JIT code cache, direct ByteBuffers, GC bookkeeping
• Why -Xmx256m routinely means 400–500+ MB RSS — and how to itemize every byte with NativeMemoryTracking + jcmd VM.native_memory
• Why container-awareness (MaxRAMPercentage, default 25%) still leaves non-heap memory unprotected
• Inside the heap: bump-pointer allocation in eden, why most request objects are already garbage at minor GC, and why your Spring singletons retire to old gen forever
• Exit 137 mechanics: the cgroup limit meters the ENTIRE process RSS, and the kernel kills from outside — no heap dump, mid-request
• The fix: size your container for the whole process — heap, stacks, Metaspace, code cache — not just -Xmx

Chapters:
0:00 Cold open
0:19 The problem
1:12 The naive solution
1:50 How it actually works
3:50 At scale
4:23 Takeaways


On this page of the site you can watch the video online JVM Memory Map: Why Your Heap-Limited Spring Boot App Gets OOM-Killed (Exit 137) with a duration of hours minute second in good quality, which was uploaded by the user Visual Computer Science 19 July 2026, share the link with friends and acquaintances, this video has already been watched 211 times on youtube and it was liked by 8 viewers. Enjoy your viewing!