What is the difference between Java Non Heap Memory and Stack Memory? Are they Same if not what is the difference between them?

前端 未结 3 913
被撕碎了的回忆
被撕碎了的回忆 2020-12-25 14:41

I am using Jconsole for monitoring a Java Application. The memory tab shows different Heap and Non Heap memories like

  1. Heap Memory Usage
  2. Non Heap Memor
3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-25 15:41

    Non-heap memory is all the memory the JVM allocated for purposes other than the heap. This includes:

    • the call stacks (as you noted);
    • memory allocated by native code (e.g. for off-heap caching);
    • in HotSpot 8, the Metaspace (replacement for the Permanent Generation);
    • memory used by the JIT compiler (compiled native code).

    In your list, "CMS Old Gen", "Par Eden Space", "Par Survivor Space", and "CMS Perm Gen", all refer to various sections of the heap.

提交回复
热议问题