Who Ate My RAM?
summary
Analysis of a JVM out-of-memory crash showing that memory reserved outside -Xmx (thread stacks, metaspace, code cache, direct buffers, mmaped files and C library anonymous mappings) can cause os::commit_memory failures. Reproduction uses parent/child JVMs with Xms=Xmx and -XX:+AlwaysPreTouch to force page faults so the kernel OOMs; diagnosis uses jcmd VM.native_memory, /proc/<pid>/smaps, pmap, strace and dmesg. Recommended fixes are to avoid pretouch or reduce native reservations and thread stack sizes.
AI-written summary · about
chapters (8)
- 0:00Introduction
- 4:22OS basics
- 13:15Memory allocation
- 24:20JVM memory layout
- 31:56VM behavior
- 37:56Memory analysis tools
- 40:06Parent-child processes
- 42:17Summary
related talks
32mMastering JVM Memory Troubleshooting - From OutOfMemoryErrors to Leaks
02h 41mCures for OOMKills, Warm-ups, and Slowness in JVM Containers
52mMemory footprint of a Java process
43mTroubleshooting Memory Problems in Java Applications
34mTroubleshooting Native Memory Issues in Java Applications
51mOOMs!... I did it again
48mJava Memory Management Best Practices
45mCatching the 137-Killer: A Java Memory Forensics Investigation
