Search code examples
javaperformanceshared-memoryjmappmap

'Shared Object Memory' vs 'Heap Memory' - Java


What is difference between 'Shared Object Memory' and 'Heap Memory' in Java. Is it like 'Shared Object Memory' is superset of 'Heap Memory'?

The source of this question is documentation of jmap. It provides different options to Print 'Shared Object Memory' and 'Heap Memory'.


Solution

  • From my analysis so far:

    The default option would print all the memory information including:

    • Heap Memory
    • Perm Gen
    • Other Memory (including JNI, Stack space, etc)

    This analysis if on the basis of followings:

    In JDK docs it is mentioned that the default options (which is 'Shared Object Memory') is similar to pmap command of Solaris. Looking at pmap command, it seems it prints the complete memory information.

    Please add comments to validate this understanding.