---
# System prepended metadata

title: Java heap space error

---

# Java heap space error

OutOfMemoryErrors in Java are a common cause of system downtime. Although many of them are simple to diagnose and fix, they disrupt production, and obscure errors can take hours or days to troubleshoot. Part of the problem is that many troubleshooting guides concentrate solely on the [Java heap space](https://blog.heaphero.io/the-anatomy-of-a-java-lang-outofmemoryerror-more-than-just-a-heap-space-error/). Although the issue frequently relates to the heap, this is not always the case. It helps to have a broader understanding of the JVM memory model, and how different types of OutOfMemoryError correspond to it.

![The-Anatomy-of-a-java.lang_.OutOf-MemoryError](https://hackmd.io/_uploads/Hk9xEwR5-e.jpg)
