Troubleshooting Native Memory Issues in Java Applications
summary
Identifies native OutOfMemoryError as the JVM running out of C heap or native allocations and demonstrates concrete diagnostics: monitor RSS/PSS with ps/top/pmap, compare pmap snapshots, inspect JVM pools with JConsole/JMC, enable native memory tracker (NMT) to split JVM-internal allocations, use je_malloc + jeprof to heap‑profile native mallocs and valgrind with suppressions for external leaks. Shows a deflater native init consuming ~95% of allocations, notes NMT costs ~5–10% and je_malloc ~2%, and uses core files/GDB to find JNI code that never frees memory.
AI-written summary · about
chapters (13)
- 0:00Intro
- 1:09What is a Native OutOfMemoryError ?
- 3:02Native memory leaks are hard to diagnose
- 6:11Confirm Native Memory Leak
- 7:43Heap or Non-Heap areas of the JVM
- 11:10Diagnose Native Memory Leaks
- 11:49Native Memory Leaks within the JVM - NMT
- 15:32Native Memory Leaks from Outside the JVM
- 16:19jemalloc
- 22:10valgrind
- 25:14pmap and core files
- 28:44Common scenarios
- 33:33Summary
related talks
43mTroubleshooting Memory Problems in Java Applications
32mMastering JVM Memory Troubleshooting - From OutOfMemoryErrors to Leaks
31mThe Dark Side of Java
21mMemory Efficient Java
38mMemory Efficient Java
48mJava Memory Management Best Practices
02h 41mCures for OOMKills, Warm-ups, and Slowness in JVM Containers
51mOOMs!... I did it again
