Fetch Java Heap memory details

Hi All,

There is a very nice utility in Java where we can print shared object memory maps or heap memory details of a given process or core file or a remote debug server. It can be found inside bin folder of Java Home.

jmap.exe

Options:
jmap [ option ] pid
jmap [ option ] executable core
jmap [ option ] [server-id@]remote-hostname-or-IP

Command:
jmap -histo

Output:

——— Detailed Heap Statistics: ———
31.9% 11488k   110191   -677k [C
8.5% 3080k   131426   -170k java/lang/String
7.8% 2809k    25683    +18k java/lang/Class
5.9% 2126k     7613   -134k [B
3.9% 1392k    16032    -52k [Ljava/util/HashMap$Entry;
2.7% 980k    10832    -41k [Ljava/lang/Object;
2.7% 960k    40976    -57k java/util/HashMap$Entry
2.4% 861k     4486     -5k [I]

2.3% 844k    27029    -11k java/util/LinkedHashMap$Entry
1.7% 613k    26180     +4k java/util/Hashtable$Entry
1.6% 581k    12403     -5k java/lang/ref/SoftReference
1.2% 437k    18658     +0k weblogic/utils/collections/ConcurrentHashMap$Entry
1.2% 415k     7597     +0k java/util/LinkedHashMap
1.1% 392k     4263     +0k [Ljava/lang/String;
1.1% 392k     8369    -11k java/util/HashMap
1.1% 379k     4228     -6k [Ljava/util/Hashtable$Entry;
1.0% 360k    15400     +3k javax/xml/namespace/QName
1.0% 351k     9004     +0k java/lang/ref/WeakReference
0.9% 309k     3957   -605k java/lang/reflect/Method
0.8% 293k     5370     -1k com/bea/staxb/buildtime/internal/bts/QNameProperty
0.7% 246k    15764     +0k com/bea/staxb/buildtime/internal/bts/MethodName
0.6% 210k      186     +0k [Lweblogic/utils/collections/ConcurrentHashMap$Entry;
0.6% 207k     6648     +1k java/util/concurrent/ConcurrentHashMap$Segment
0.5% 189k     6638     +0k [Ljava/util/concurrent/ConcurrentHashMap$HashEntry;
0.4% 158k     6753     +0k java/util/concurrent/locks/ReentrantLock$NonfairSync
0.4% 156k     2511     +0k java/beans/PropertyDescriptor
0.4% 153k     3923     -3k java/util/Hashtable
0.4% 146k     9361     -6k java/lang/Long
0.4% 141k     4532     +0k java/util/TreeMap$Entry
0.4% 128k     1374     +0k com/bea/xbean/schema/SchemaLocalElementImpl


Thanks
R Vashi

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s