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
 Instance[] instances(Selector selector)
          Get information about ob oject instances accessible from specified roots.
 Link[] links(Selector src, Selector dst)
          Find links between objects matching search criteria
 java.lang.Object[] referencedBy(java.lang.Object obj)
          Get list of objects referencing this object
 Instance[] referencedByClass(java.lang.Object obj)
          Get list of classes which instances reference this object
 void refresh()
          Build object closure - collect heap info
 Relation[] 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 Instance[] instances(Selector selector)
Get information about ob oject instances accessible from specified roots.

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

links

public Link[] links(Selector src,
                    Selector dst)
Find links between objects matching search criteria

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

referencedBy

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

Parameters:
obj - referened object
Returns:
array of objects referencing this object

referencedByClass

public Instance[] referencedByClass(java.lang.Object obj)
Get list of classes which instances reference this object

Parameters:
obj - referened object
Returns:
array of classes which instances reference this object in instance count decreasing order

refresh

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


relations

public Relation[] relations(Selector src,
                            Selector dst)
Find relations between classes matching search criteria

Parameters:
src - condition for referencing object
dst - condition for referened object
Returns:
array of Relation in links count decreasing order