(The Java heap (where each Java object is allocated) is the area of ??memory that you use most frequently when writing Java applications. The JVM is designed to isolate us from the features of the host, so it's only natural to think of memory as a heap. You must have encountered a Java heap OutOfMemoryError, it may be caused by a target leak, or it may be because the heap is not large enough to store all data, and you may also understand some debugging techniques for these scenarios. But as your Java application manages ever-increasing data and ever-increasing concurrent loads, you may encounter OutOfMemoryErrors that cannot be fixed using conventional techniques. In some scenarios, an error will be thrown even if the java heap is not full. When such a scenario occurs, you need to understand what's going on inside the Java Runtime Environment (JRE).
JVM Memory Details.pdf)