本文转自:点击打开链接
Java Heap Memory is part of memory allocated to JVM by Operating System.
Objects reside in an area called the heap. The heap is created when the JVM starts up and may increase or decrease in size while the application runs. When the heap becomes full, garbage is collected.
You can find more details about Eden Space, Survivor Space, Tenured Space and Permanent Generation in below SE question:
Young , Tenured and Perm generation
PermGen has been replaced with Metaspace since Java 8 release.
Regarding your queries:
- Eden Space, Survivor Space, Tenured Space are part of heap memory
- Metaspace and Code Cache are part of non-heap memory.
Codecache: The Java Virtual Machine (JVM) generates native code and stores it in a memory area called the codecache. The JVM generates native code for a variety of reasons, including for the dynamically generated interpreter loop, Java Native Interface (JNI) stubs, and for Java methods that are compiled into native code by the just-in-time (JIT) compiler. The JIT is by far the biggest user of the codecache.