How to Troubleshoot 9 Types of OutOfMemoryError
summary
Nine distinct OutOfMemoryError types map to specific JVM regions and require different fixes: ~80% are heap (Java heap/ESpace) leaks diagnosed by GC log + heap dump and fixed by code changes or XMX increases for traffic spikes; metaspace/PermGen needs maxMetaspaceSize or PermGen tuning; thread, code cache, direct buffer and native-JNI failures need thread dumps, code cache settings, or native diagnostics. Use tools like GCE/GC analysis, Eclipse MAT or YCrash2, and enable the onOutOfMemoryError auto-capture script to collect artifacts at failure; read the text after the colon in the exception to know the subtype.
AI-written summary · about
