Objects, Types, Gaps, Single Object, Route Features

Back to Contents
  • Objects Table - searching/listing of objects
  • Objects Settings
  • Types Table - breakdown of objects, categorized by name
  • Gaps Table - statistics on the sizes of gaps (free space) in the heap
  • Info on a Single Object - detailed info about an individual object
  • Path/Routes between Objects - finds paths/routes between two objects

  • Objects Table

    The 'objects table' gives you a view of the contents of the heapdump. It lets you see a table of the objects (arrays, classes etc. count as objects, see definitions). You can view objects in a table, sorted in various orders:

    oa - sort by address, smallest first (default)
    os - sort by size, largest first
    on - sort by name, alphabetically
    ot - sort by subtree size, largest first *
    od - sort by descendants, largest first *
    om - sort by max-depth, largest first *
    o - use previous sorting order (i.e. don't re-sort)

    Note that whether columns marked with a * are available depend on whether the dump has been processed and also the process settings.

    When you select an 'o' command you get a series of prompts enabling you to select certain objects.

    HeapRoots always limits the display of objects so that you don't end up having to CTRL-C and start again if there are too many hits - alternatively redirect to a file. So lines to be displayed are controlled by a prompt like:

    Enter range of lines to print in format 'M','L-U','-U' or 'L-' [1-25]

    See the prompts section on the Interface page.


    The example below shows the table of objects sorted by size. No filtering based on name or address has been specified and I have chosen to show matches from number 1 thru' 10 (1-10). So the table shows that the largest object was at 0x61426da8 with a size of 270,472 bytes and it was a 'primitive array' e.g. a int[] or char[] etc.

    Enter: o{a,s,t,d,m,n}, g{c,s}, t{c,s,n}, i, p, d{t,d,m} or help for more info
    > os
    
    Enter name to filter on or '-' for no filtering  [-]
    >                              don't filter based on 'names'
    Enter address range in format 'M','L-U','-U' or 'L-' [0x00000000-0xFFFFFFFF]
    >                              list objects in range 0x00000000-0xFFFFFFFF, i.e. all of them
    Enter range of lines to print in format 'M','L-U','-U' or 'L-' [1-25]
    > 1-10                         matches 1-10
    Sorting by size ...
    .........................................                              done.
    Showing all objects, sorted by size.
    
    Addr       Size         Name
    -------------------------------------------------------------------------------
    0x61426da8 270,472      primitive array
    0x60000200 149,520      primitive array
    0x7a8c3410 131,088      array of java/lang/String
    0x63426020 94,248       primitive array
    0x64fc2bf0 86,960       array of java/lang/String
    0x8cfe3890 85,336       array of java/lang/String
    0x67196a88 84,152       array of java/lang/String
    0x86196420 83,384       array of java/lang/String
    0x6b86f5c8 83,000       array of java/lang/String
    0x75e69da8 82,840       array of java/lang/String
    (20456728 matches but only displayed up to 10.)
    
    Displayed results  : 1-10                        Showed only 10 out of 20,456,728 objects
    Matched objects    : 20,456,728 / 20,456,728     All objects matched (no filtering applied) and the total size
    Total Size         : 770,345,168 / 770,345,168   of the matches, was the total size of all objects.
    

    I have seen from the gaps table that there is an object at address 0x60000200 which has a gap before it of 786,506,216 bytes. I would like to investigate this gap and see what objects surround it.

    So I, sort the objects by address and filter for the objects up to and including those at address -0x60000200.

    Enter: o{a,s,t,d,m,n}, g{c,s}, t{c,s,n}, i, p, d{t,d,m} or help for more info
    > oa                                         View objects, sorted by address
    
    Enter name to filter on or '-' for no filtering  [-]
    >
    Enter address range in format 'M','L-U','-U' or 'L-' [0x00000000-0xFFFFFFFF]
    > -0x60000200                  Objects upto address 0x60000200
    Enter range of lines to print in format 'M','L-U','-U' or 'L-' [1-10]
    > 1-5                          Only show matches 1 to 5
    Sorting by address ...
    ...................................
    Showing objects whose address <= 0x60000200, sorted by address.
    
    Addr       Size         Name
    -------------------------------------------------------------------------------
    0x30280018 256          class java/lang/NoClassDefFoundError
    0x30280118 256          class java/lang/Class
    0x30280218 256          class java/lang/Object
    0x30280318 256          class java/lang/Throwable
    0x30280418 256          class java/io/Serializable
    
    Displayed results  : 1-5                  # Only showing 5 out of 735 objects found.
    Matched objects    : 735 / 20,456,728     # 735 objects with address up to 0x60000200.
    

    I haven't actually found the object immediately before 0x60000200 since I limited the output to just show 5 objects (there could have been millions). But, I now know there are 735 objects before this one and I've seen 1-5 (in address order).

    So for my next attempt, I view objects from number (by address order) 730 onwards with address upto 0x60000200.

    Enter: o{a,s,t,d,m,n}, g{c,s}, t{c,s,n}, i, p, d{t,d,m} or help for more info
    > o 730-   # Repeat previous command but just change result set displayed.
               # See shortcuts Interface section or 'help o'. 
    Showing objects whose address <= 0x60000200, sorted by address.
    
    Addr       Size         Name
    -------------------------------------------------------------------------------
    0x311edb18 256          class javax/naming/spi/ContinuationDirContext
    0x311edc18 256          class javax/naming/spi/ContinuationContext
    0x311edd18 256          class com/sun/jndi/toolkit/ctx/ComponentContext$2
    0x311ede18 256          class javax/naming/LinkRef
    0x311edf18 256       .....   this is the object immediately before 0x60000200
    0x60000200 149,520      primitive array
    
    Displayed results  : 730-                 # We see results 730,731,732,733,734,735
    Matched objects    : 735 / 20,456,728     # 735 objects with address up to 0x60000200.
    

    Now I've found that the object before (in address order) 0x60000200 is at address 0x311edf18.

    I said earlier that the gap was 786,506,216 bytes. Since 0x311edf18 is 256 bytes in size, it ends at address 0x311ee018 (adding on 256 using trusty Windows calc.exe, although 256 goes nicely in hex...). So the difference between where 0x311edf18 ends and 0x60000200 starts is 0x311ee018 - 0x60000200 = 0x2EE121E8 which is 786506216 in decimal. This shows that the gap table got its sums correct on this occasion.


    As a pure example, I am interested in objects with 'ibm' in the name. By filtering on name, not filtering on address, but limiting the display to 10 items, I can see that there were 526595 objects with 'ibm' in the name. The totals at the bottom, tell me that about 16mb of the total 129mb of objects in the heap had 'ibm' in their name.

    Enter name to filter on or '-' for no filtering  [-]
    > ibm                        This will match anything with 'ibm' in its name,case-insensitive.
    Enter flag string to filter on or '-' for no filtering [-]
    >                            Can filter on flags as well as by name.
    Enter address range in format 'M','L-U','-U' or 'L-' [0x00000000-0xFFFFFFFF]
    >
    Enter range of lines to print in format 'M','L-U','-U' or 'L-' [1-25]
    > 1-10                       Just show matches 1 to 10
    Showing objects whose name contains 'ibm', sorted by address.
    
    Addr       Size      Flags   Name
    -------------------------------------------------------------------------------
    0x312b48f0 48,048    LF:0 M   array of com/ibm/ejs/util/Bucket
    0x31290d20 48,048    LF:0 M   array of com/ibm/ejs/util/Bucket
    0x31525018 16,416    LF:0 M   array of com/ibm/ejs/util/cache/Bucket
    0x3133bd78 16,416    LF:0 M   array of com/ibm/ejs/util/cache/Bucket
    0x314a2220 8,232     LF:0 M   array of com/ibm/ejs/util/Bucket
    0x312c04a0 8,232     LF:0 MA  array of com/ibm/ejs/util/cache/Bucket
    0x31128108 4,112     LF:0 MA  array of com/ibm/ejs/util/adt/Comparable
    0x3156f2d8 1,648     LF:0 MP  array of com/ibm/rmi/util/IdentityHashtableEntry
    0x31a49ad0 1,648     LF:0 M   array of com/ibm/rmi/util/IdentityHashtableEntry
    0x310e14b0 1,040     LF:0 MP  array of com/ibm/ejs/util/Bucket
    
    Displayed results  : 1-10                        Results 1-10 out of 526,595
    Matched objects    : 526,595 / 2,045,571         526k out of 2m objects total had ibm in name.
    Total Size         : 16,653,256 / 129,581,536    these objects took 16mb of the total size of objects in heap
    

    The totals at the bottom show what proportion of objects had 'ibm' in their name (about 25%) and what proportion of the total heap usage they accounted for (about 12%).

    You can negate the name searches by putting a '!' in front of the string. I could repeat the search but look for objects which don't contain 'java' in their name by running 'o !java' (see shortcuts Interface section or 'help o'.)

    This dump has flags for each object. You can filter on these flags e.g. entering '!LF:0' in the above 'flags' prompt will only show objects which don't have the stirng 'LF:0' in their flags string. These flags aren't interpreted by HeapRoots and their meaning is dependant on the JVM. See FAQ.


    The objects table has extended filtering functionality and display columns when the dump has been processed.

    Extra columns are available such as "subtree sizes" and "#descendants" (depending on process settings). The data can be sorted according to these columns with 'ot' and 'od' respectively.

    If I run 'ot' before processing, I am told that I need to process the dump to calculate subtree-sizes before I can sort by them.

    Enter: o{a,s,t,d,m,n}, g{c,s}, t{c,s,n}, i, p, d{t,d,m} or help for more info
    > ot                 Try to show objects, sorted by total sizes
    
    To sort by 'total-size' you need to process. (Check setup with '? p' and then 'p' to re-process.)
                         HeapRoots hasn't calculated these yet!
    
    Enter: o{a,s,t,d,m,n}, g{c,s}, t{c,s,n}, i, p, d{t,d,m} or help for more info
    > p                  So process.
    

    After processing, I try again using all of the default settings. Note that there is now an additional prompt to filter the objects further. The definitions explain what is meant by a Root/Pure Root, an Artificial Root and a Non-Root. The output below is from processing hddocaddr.txt which corresponds to hddoc.png.

    > ot
    
    Enter name to filter on or '-' for no filtering [-]
    >
    Enter combination of types to show, R for Roots, A for Artificial Roots, N for Non-Roots [R,A,N]
    >               Accept the default, to show objects of the form R,N or A - i.e. all of them
    Enter 0x of a 'root' to show only objects owned by it or '-' for no filtering [-]
    >
    Enter address range in format 'M','L-U','-U' or 'L-' [0x00000000-0xFFFFFFFF]
    >
    Enter range of lines to print in format 'M','L-U','-U' or 'L-' [1-25]
    >
    Showing all objects, sorted by total-size.
    
      Addr       Size       Root-owner Parent     Total-size  Name
    -------------------------------------------------------------------------------
    A 0x200000b0 40,000     -          -          48,000      K
    R 0x50001010 6,000      -          -          26,600      A
    N 0x50002020 4,000      0x50001010 0x50001010 20,600      B
    N 0x50004050 1,104      0x50001010 0x50002020 13,672      C
    N 0x50005060 1,032      0x50001010 0x50004050 12,568      D
    N 0x50003090 504        0x50001010 0x50005060 11,536      E
    N 0x50003070 1,000      0x50001010 0x50003090 11,000      F
    N 0x30000080 10,000     0x50001010 0x50003070 10,000      G
    N 0x200000c0 8,000      0x200000b0 0x200000b0 8,000       L
    N 0x50006040 1,904      0x50001010 0x50002020 1,904       I
    N 0x10007030 1,024      0x50001010 0x50002020 1,024       J
    N 0xe00090a0 32         0x50001010 0x50003090 32          H
    
    Matched objects    : 12 / 12
    Total Size         : 74,600 / 74,600
    Total Subtree Size : 164,936        # Meaningless in this case because a lot of the
                                        # objects are counted multiple times.
    

    This table now shows each objects 'root-owner', 'parent-owner', 'subtree size' and its basic category (e.g. 'non-root').

    Note that pure-roots such as 0x50001010 and artificial roots such as 0x200000b0 do not have owners.

    You can see which objects are owned by the root 0x50001010, for example 0x50002020 which is the next biggest object underneath it (see objects A and B in hddoc.png in Definitions & Algorithms) You will notice that all of the objects owned by a root are smaller in total size that the root since they are deeper down the tree (the depth-first "tree" from the root).


    The above use of the Object table with the processed data isn't that useful in analysis because there is too much data. We know that a root's children are going to be smaller than it and have fewer descendants, so including them in the list may not be worthwhile.

    I will now filter out the non-roots, by only showing objects which are A or R.

    > ot
    
    Enter name to filter on or '-' for no filtering [-]
    >
    Enter combination of types to show, R for Roots, A for Artificial Roots, N for Non-Roots [R,A,N]
    > ar                      Only show the root types, artificial(A) or pure(R)
    Enter 0x of a 'root' to show only objects owned by it or '-' for no filtering [-]
    >
    Enter address range in format 'M','L-U','-U' or 'L-' [0x00000000-0xFFFFFFFF]
    >
    Enter range of lines to print in format 'M','L-U','-U' or 'L-' [1-25]
    >
    Showing objects whose type is in 'AR', sorted by total-size.
    
      Addr       Size       Root-owner Parent     Total-size  Name
    -------------------------------------------------------------------------------
    A 0x200000b0 40,000     -          -          48,000      K
    R 0x50001010 6,000      -          -          26,600      A
    
    Matched objects    : 2 / 12
    Total Size         : 46,000 / 74,600
    Total Subtree Size : 74,600  The total subtree size of the roots, is the total size of all the objects
    

    Now we can see just the roots, sorted by the #descendants. Note, the observation in bold above.


    This is a useful query (on a real dump this time) for seeing the top 10 root objects in terms of size. Note that I've turn on all the process data (descendants,max-depth) with the process settings and turned off the 'parent' and 'root-owner' columns (since these don't give any information on root objects) using the object settings.

    Enter: o{a,s,t,d,m,n}, g{c,s}, t{c,s,n}, i, p, d{t,d,m} or help for more info
    > ot                          sort by total size
    
    Enter name to filter on or '-' for no filtering [-]
    >
    Enter combination of types to show, R for Roots, A for Artificial Roots, N for Non-Roots [R,A,N]
    > A,R                         Only roots
    Enter 0x of a 'root' to show only objects owned by it or '-' for no filtering [-]
    >
    Enter address range in format 'M','L-U','-U' or 'L-' [0x00000000-0xFFFFFFFF]
    >
    Enter range of lines to print in format 'M','L-U','-U' or 'L-' [1-25]
    > 1-10                        Only interested in the biggest 10
    
    Showing objects whose type is in 'A,R', sorted by total-size.
    
      Addr       Size       Total-size  Descend.  Depth  Name
    -------------------------------------------------------------------------------
    R 0x00555a30 248        70,907,808  837,793   418    class java/lang/System
    A 0x101963d0 32         8,380,272   43,501    3,070  java/lang/ref/Finalizer
    A 0x1d521820 112        3,708,912   5,975     12     org/apache/xpath/XPathContext
    R 0x129d2930 24         3,670,304   5,971     17     org/apache/xpath/objects/XNodeSet
    A 0x216cdc08 112        2,017,160   3,155     12     org/apache/xpath/XPathContext
    A 0x20b503d0 112        2,017,160   3,155     12     org/apache/xpath/XPathContext
    A 0x191457d0 56         2,016,728   3,147     15     array of java/lang/Object
    R 0x13a2c660 24         1,933,448   3,064     17     org/apache/xpath/objects/XNodeSet
    R 0x1327ceb0 24         1,933,056   3,060     17     org/apache/xpath/objects/XNodeSet
    R 0x1d42f3a0 24         1,933,056   3,060     17     org/apache/xpath/objects/XNodeSet
    
    Displayed results  : 1-10
    Matched objects    : 1,055,309 / 2,888,035       Huge number of roots!
    Total Size         : 46,463,624 / 267,753,280
    Total Subtree Size : 267,753,280                 The roots plus their descendants account for everything
    Total Descendants  : 1,832,726                   The objects which aren't roots
    

    The class java/lang/System reaches 70mb, a quarter of the objects (in size and numbers) in the heap! This isn't unusual, but will provide a starting point for analysis, e.g. by Dumping from Roots (see example.)

    Note that the deepest chain/tree is from a 'java/lang/ref/Finalizer' and goes to a depth of '3,070'.

    Top


    Objects Settings

    Run '? o' to change settings.

    See this default line of output:

      Addr       Size       Root-owner Parent     Total-size  Descend.  Depth  Name
    -------------------------------------------------------------------------------
    N 0x10199fc0 3,704      0x007d8b98 0x101960b0 58,832      1,788     7      array o
    f java/util/Hashtable$Entry
    

    The settings let you turn on a display of refs of each object and alter the display of the columns. I want to remove some of the columns and show the references of each object.

    > ? o
    
    Settings for 'Objects Dump' :
    
    Show references of each object ?                            [N]
    > Y             # Lets see the references
    Max number of refs to show (or -ve for unlimited)           [10]
    > 5             # I only want to see 5 refs of each object
    Select display columns (the available subset will display) [YASFOPTDMN]
    type(Y), address(A), size(S), flags(F), root-owner(O), parent(P), total-size(T), descendants(D), max
    -depth(M), name(N)
    > ASON          # I will see address, size, root-owner and name only.
    

    The output is now:

    Addr       Size       Root-owner Name
    -------------------------------------------------------------------------------
    0x10199fc0 3,704      0x007d8b98 array of java/util/Hashtable$Entry
            0x10197458 0x10199600 0x10193df8 0x101975f8 0x101979e8 ... (362)
            # First 5 references, the '... (362)' indicates there are 362 in total.
    

    Top


    Types Table

    The types table adds up the numbers of each distinct name given in the dump. It also adds up the total amount of space used by each 'type'. For example if 4000 lines in the heapdump have the string 'java/lang/String' then the 'Count' of 'java/lang/String' will be 4000. Any distinct name will be counted separately, so 'java/lang/String' will be distinct to 'array of java/lang/String' or 'class java/lang/String'. See the definition of an 'object'.

    I run 'ts' here to show types sorted by size (this is the total size of all objects of that type).

    Enter: o{a,s,t,d,m,n}, g{c,s}, t{c,s,n}, i, p, d{t,d,m} or help for more info
    > ts
    
    Enter name to filter on or '-' for no filtering  [-]
    >                                 No filtering
    Enter range of lines to print in format 'M','L-U','-U' or 'L-' [1-25]
    > 1-10                            Show top 10 biggest types
    Tabulating all objects, sorted by total-size
    
    Count     Size        Name
    ------------------------------------------------------------------
    5,277,880 211,115,200 java/util/TreeMap$Entry
    4,747,754 151,928,128 java/lang/String
    4,293,977 130,807,056 primitive array       Always gonna see lots of primitive arrays
    1,546,945 74,253,360  java/util/TreeMap
    986,792   56,042,472  array of java/lang/Object
    411,991   36,255,208  javax/naming/NameImpl
    984,896   31,516,672  java/util/Vector
    339,915   21,754,560  com/ibm/di/config/base/AttributeMapItemImpl
    903,674   14,458,784  java/util/TreeMap$3
    411,983   9,887,592   javax/naming/CompoundName
    
    Displayed results : 1-10                    # Display 1-10 out of 1955.
    Matched types  : 1,955 / 1,955              # 1955 distinct types.
    Usage count    : 20,456,728 / 20,456,728
    Total size     : 770,345,168 / 770,345,168
    

    We can see that a lot of space is taken up by 'TreeMap' objects. There are about 5 million java/util/TreeMap$Entry objects taking up 211mb just by themselves.

    Also the number of types gives an indication of the number of classes, 1955 is quite an average amount. We could filter on the name 'class' to just include anything with 'class' in the name to get a slightly more accurate number.

    I'm now interested in exactly how much TreeMap stuff there is and so I just want to see types with 'java/util/TreeMap' in the name. See the built-in help 'help ts' for information on arguments.

    > ts java/util/TreeMap  # Repeat previous, just set the name-filter.
    
    Tabulating objects whose name contains 'java/util/TreeMap', sorted by total-size
    
    Count     Total-Size  Type Name
    ------------------------------------------------------------------
    5,277,880 211,115,200 java/util/TreeMap$Entry
    1,546,945 74,253,360  java/util/TreeMap
    903,674   14,458,784  java/util/TreeMap$3
    45,001    720,016     java/util/TreeMap$1
    541       21,640      java/util/TreeMap$Iterator
    29        464         java/util/TreeMap$2
    1         256         class java/util/TreeMap$Iterator
    1         256         class java/util/TreeMap$3
    1         256         class java/util/TreeMap$2
    1         256         class java/util/TreeMap$1
    1         256         class java/util/TreeMap
    1         256         class java/util/TreeMap$Entry
    
    Exact match for 'org/apache/xerces/dom/AttrNSImpl'.
    
    Count     Total-Size  Type Name
    ------------------------------------------------------------------
    1,546,945 74,253,360  java/util/TreeMap  We've had an exact match for the name
    
    Matched types  : 12 / 1,955
    Usage count    : 7,774,076 / 20,456,728    Nearly 8 million of the little...
    Total size     : 300,571,000 / 770,345,168 That's a lot of TreeMap
    

    This shows a few types of TreeMap with over 7 million object instances, taking up 300mb of heapspace! This could be a very large application (like HeapRoots!) or a very leaky application.

    You could also do 'tc' to see the types sorted in order of instances/count. This would show you which objects were most common in the heap. You'll normally see a similar list of objects in either 'tc' or 'ts' though since the objects which take up the most space tend to be those for which there are a large number of instances and vice-versa.


    When processed, you can also filter on 'root-owner' to identify just the objects which are owned by a particular root. You will be prompted to specify a 'root-owner' if you like when you run any 't' command. e.g. if 0x00555a30 is a root:

    > ts 0x00555a30          # Skip prompts
    
    Tabulating objects whose root-owner equals '0x00555a30', sorted by total-size
                  ............................
    

    Top


    Gaps Table

    The gaps table is similar to the types table in use but analyses the free spaces in the heap. The heap has 'gaps' (free space) inbetween objects which can be calculated by looking at each object's starting point (its address) and adding on its size.

    The gaps are tabulated according to their sizes. Here we can see that this heap is very well compacted (not fragmented) - so compaction is doing a good job. This is because there are 20.42 million objects (out of about 20.46m) which have a gap before them of 0 bytes.

    The example column gives (I think the first) object whose gap before its starting address matches that gap size. e.g. object at 0x6023ff10 has 40 bytes free space after the next lowest-addressed object's end.

    The 'gc' command shows the gaps sorted by 'Count' with the most frequent size first.

    Enter: o{a,s,t,d,m,n}, g{c,s}, t{c,s,n}, i, p, d{t,d,m} or help for more info
    > gc                     Look at the most frequent sizes of gap
    
    Enter range of lines to print in format 'M','L-U','-U' or 'L-' [1-25]
    > 1-10
    Gap Size      Count       Example of an object before gap
    -------------------------------------
    0             20,418,106  0x30280118 Very compacted heap
    40            8,180       0x6023ff10
    24            4,038       0x600f4580 Many small but nonzero gaps
    200           3,419       0x600f9c50 could indicate that GC is    
    88            2,045       0x60583910 unable to compact.           
    48            695         0x60459878
    456           664         0x61a26e68
    264           613         0x61c00220
    32            597         0x600f4850
    184           531         0x600f4b98
    
    Displayed results    : 1-10           # Showing 10 out of 1215 gap sizes.              
    Number of gap sizes  : 1,215          # 1215 different sizes of gap.
    Total gap size       : 837,645,080    # Total size of all gaps between objects.
    

    The total gap size may represent the free space in the heap. This assumes that the heap is a contiguously addressed single region of memory, which may not always be a correct assumption depending on JVM.


    Now I want to see all of the smallest gaps in the heap. I use the 'gs' command to show gaps, sorted by size - largest first. I know there are 1215 gap sizes so I show from size 1200 onwards.

    Enter: o{a,s,t,d,m,n}, g{c,s}, t{c,s,n}, i, p, d{t,d,m} or help for more info
    > gs 1200-      # Sort by size, largest gap first.
                    # Show results 1200 onwards.
    
    Gap Size      Count       Example of an object before gap
    -------------------------------------
    120           343         0x61a3ae60
    112           285         0x617e67e8
    104           70          0x61a41fe0
    96            239         0x61a1a9b0
    88            2,045       0x60583910
    80            396         0x61a2fd70
    72            170         0x60465230
    64            384         0x617e19a8
    56            443         0x600f9d78
    48            695         0x60459878
    40            8,180       0x6023ff10
    32            597         0x600f4850
    24            4,038       0x600f4580
    16            297         0x600f7f50
    8             257         0x60058578
    0             20,418,106  0x30280118
    
    Displayed results    : 1200-
    Number of gap sizes  : 1,215
    Total gap size       : 837,645,080
    

    The above table shows the distribution of small gaps in the heap.

    Top


    Info on a Single Object

    The 'i' command lets you get simple information on an individual object, such as the references from and to the object. Here I've specified object 0x007d0bb8 and opted to show lines 1-10 of the references.

    > i              # Can specify address as argument, see 'help i'
    
    Enter 0x for object to show info on [-]
    > 0x007d0bb8                    specify object
    Enter range of lines to print in format 'M','L-U','-U' or 'L-' [1-25]
    > 1-10                          references 1-10
                          
    Name : class java/lang/ClassLoader
    
    REFERENCES TO / PARENTS of 0x007d0bb8
                          Other objects which reference the object
    Addr.      Size          Name
    -------------------------------------------------------------------------------
    0x007d5b28 248           class com/ibm/jvm/ExtendedSystem       1
    0x101add28 40            java/lang/reflect/Field                2
    0x101add90 24            com/ibm/jvm/ExtendedSystem$1           3
    0x101ade08 40            java/lang/reflect/Field                4
    
    REFERENCES FROM / CHILDREN of 0x007d0bb8
                          Children/references/object fields of object
    Addr.      Size          Name
    -------------------------------------------------------------------------------
    0x101bc1a0 24            array of java/lang/String              5
    0x101bc4e0 104           array of java/lang/String              6
    0x10185f88 32            java/util/Stack                        7
    0x10185fe0 32            java/util/Vector                       8
    0x10186038 32            java/util/Vector                       9
    0x10181830 104           sun/misc/Launcher$AppClassLoader       10
    
    Displayed results : 1-10
    Total refs        : 20     
    Parents, Children : 4 , 16         4 inward and 16 outward references
    Root Type         : N              This is not a root
    Root-Owner        : 0x007d5b28     Its root-owner
    Parent-Owner      : 0x007d5b28     designated parent-owner
    Total size        : 13,176         The size of objects below it in the tree
    Descendants       : 236            Number of objects below it in the tree
    Size              : 248 / 759,072  Size out of total heap usage
    

    The only thing to note here is that you can control how many references in total are displayed (here 1-10). HR shows the parents and then the children of the object in the two tables above. Each reference/table line printed counts towards the range you specify.

    Here only 6 out of the 16 children are displayed because after showing 4 parents and then 6 children, lines 1-10 have already been printed. If you want to see all of the children, then specify '5-' which will print from line 5 onwards - skipping the 4 lines needed to print the parent references. I know this isn't ideal!

    Top


    Path/Routes between Objects

    The 'r' command will find a route from one object to another if it exists. This isn't guaranteed to be the shortest route, just a route.

    > r 0x3827ba18 0x30310798   # Don't have to specify both arguments,
                                # will get prompted otherwise - see 'help r'.
    Use Softlinks      : true
    Finding route from : 0x3827ba18 'class java/util/jar/JarFile'
                    to : 0x30310798 'java/lang/String'
    ...
    Path length is 15
    
    Addr       Refs  Name
    --------------------------------------------------------------
    0x3827ba18 3     class java/util/jar/JarFile
    0x302e4300 1     java/util/Vector
    0x30ec3dd8 140   array of java/lang/Object
    0x302fc3e8 2     java/lang/ref/SoftReference
    0x302fc428 4     java/util/jar/JarFile
    0x302fc0f0 2     java/util/jar/Manifest
    0x302fc030 1     java/util/HashMap
    0x30327728 278   array of java/util/HashMap$Entry
    0x303119e0 3     java/util/HashMap$Entry
    0x303107b8 2     java/util/HashMap$Entry
    0x30310828 1     java/util/jar/Attributes
    0x303107f0 2     java/util/HashMap
    0x303107d8 1     array of java/util/HashMap$Entry
    0x30310718 2     java/util/HashMap$Entry
    0x30310798 1     java/lang/String
    

    This means that starting at 'class java/util/jar/JarFile', you can follow references to a 'java/util/Vector', ... , all the way to the 'java/lang/String' at 0x30310798 specified. If the path was longer, then you would be prompted for how much of it to display (as with other commands like 'o' which prompt for a range).

    See that we followed a link to a 'java/lang/ref/SoftReference'. What would happen if we could only follow Strong references? I'll disallow following 'soft' links and see what happens:

    > ? r              # Modify settings with '? r' 
    
    Settings for 'Route/Path finder' :
    
    Follow soft,weak & phantom references ? [Y]
    > n                # Don't allow following soft refs
            .................
    > r 0x3827ba18 0x30310798
    
    Use Softlinks      : false
    Finding route from : 0x3827ba18 'class java/util/jar/JarFile'
                    to : 0x30310798 'java/lang/String'
    ...
    No route found.    Now there isn't a route!
    

    So it looks like the java/lang/String isn't strongly reachable from the java/util/jar/JarFile class.

    Top