Question: what is the difference between heap and non heap memory?
Answer: Heap and Non-Heap Memory The JVM memory consists of the following segments: Heap Memory, which is the storage for Java objects. Non-Heap Memory, which is used by Java to store loaded classes and other meta-data. JVM code itself, JVM internal structures, loaded profiler agent code and data, etc.