org.garret.heap
Class HeapInfo

java.lang.Object
  extended byorg.garret.heap.HeapInfo

public class HeapInfo
extends java.lang.Object


Constructor Summary
HeapInfo()
           
 
Method Summary
 void addRoot(java.lang.Object obj)
          Add object to the list of root objects
 void addRootClass(java.lang.Class cls)
          Add all static components of the class to the list of root objects
 java.util.HashMap instances(Selector selector)
          Get infirmation about ob ject instances accessible from specified roots.
 java.util.Collection links(Selector src, Selector dst)
          Find links between objects matching search criteria
 Instance[] profile(Selector selector)
          Get object instance profile.
 java.util.Collection referencedBy(java.lang.Object obj)
          Get list of objects referencing this object
 java.util.Collection referencedByClass(java.lang.Object obj)
          Get list of classes which instances reference this object
 void refresh()
          Build object closure - collect heap info
 java.util.Collection relations(Selector src, Selector dst)
          Find relations between classes matching search criteria
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HeapInfo

public HeapInfo()
Method Detail

addRoot

public void addRoot(java.lang.Object obj)
Add object to the list of root objects

Parameters:
obj - root object

addRootClass

public void addRootClass(java.lang.Class cls)
Add all static components of the class to the list of root objects

Parameters:
cls - class which static components will be added to the list of root objects

instances

public java.util.HashMap instances(Selector selector)
Get infirmation about ob ject instances accessible from specified roots.

Parameters:
selector - object selector
Returns:
HashMap with (Class,Instance) pairs

links

public java.util.Collection links(Selector src,
                                  Selector dst)
Find links between objects matching search criteria

Parameters:
src - condition for referencing object
dst - condition for referened object
Returns:
list of Link

profile

public Instance[] profile(Selector selector)
Get object instance profile.

Parameters:
selector - object selector
Returns:
array of Instance in count descending order

referencedBy

public java.util.Collection referencedBy(java.lang.Object obj)
Get list of objects referencing this object

Parameters:
obj - referened object
Returns:
list of objects referencing this object or null if this object is not accessible from specified roots

referencedByClass

public java.util.Collection referencedByClass(java.lang.Object obj)
Get list of classes which instances reference this object

Parameters:
obj - referened object
Returns:
list of classes which instances reference this object or null if this object is not accessible from specified roots

refresh

public void refresh()
Build object closure - collect heap info


relations

public java.util.Collection relations(Selector src,
                                      Selector dst)
Find relations between classes matching search criteria

Parameters:
src - condition for referencing object
dst - condition for referened object
Returns:
list of Relation