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

Publicado em: 19 Julho 2026
no canal de: 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


Nesta página do site você pode assistir ao vídeo on-line JVM Memory Map: Why Your Heap-Limited Spring Boot App Gets OOM-Killed (Exit 137) duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Visual Computer Science 19 Julho 2026, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 211 vezes e gostou 8 espectadores. Boa visualização!