Memory Matters: Troubleshooting 9 Types of OutOfMemoryError
summary
Claims that there are nine types of OutOfMemoryError with distinct causes and fixes, demonstrates reproducible failures (map grow memory leak, metaspace class generator, huge direct ByteBuffer and thread-spawning storm) and shows diagnostics that work: enable GC log + heap dump and use jcmd/jmap, Eclipse MAT or EEP/OOM analyzers to find the largest object (one demo shows a class holding 99.96% of heap), capture thread dumps (jstack/FastThread) for a 1,859-thread leak versus normal 300–400, and check kernel OOM kills; examples reliably reproduce the specific OOMs.
AI-written summary · about
chapters (14)
- 0:00Introduction and welcome
- 1:54Java process memory beyond XMX
- 6:29Causes of OutOfMemoryError
- 9:00Java heap space error
- 14:27Diagnosing memory leaks
- 23:43GC overhead limit exceeded
- 24:24Requested array size exceeds VM limit
- 26:55Metaspace OutOfMemoryError
- 32:20PermGen space error
- 33:03Unable to create native threads
- 38:43Direct buffer memory error
- 40:58Kernel kills Java process
- 44:08Native memory exhaustion
- 44:53Q&A and closing
