com.jrockit.memleak.value
Class HeapInfo

java.lang.Object
  extended by com.jrockit.memleak.value.HeapInfo
All Implemented Interfaces:
IHeapInfo
Direct Known Subclasses:
HeapHistogram, JoinedTypeHeapInfo, TypeHeapInfo

public abstract class HeapInfo
extends java.lang.Object
implements IHeapInfo

Represents heap usage for a single type, including growth rate. This only includes memory used by the instances themselves. That is, objects referenced by instance fields are not included, nor are class objects and static fields.


Field Summary
protected  float growthRate
           
protected  int numInstances
           
protected  long size
           
 
Fields inherited from interface com.jrockit.memleak.IHeapInfo
EMPTY_ARRAY
 
Constructor Summary
protected HeapInfo(int numInstances, long size, float growthRate, long creationMillis)
          Full state constructor.
  HeapInfo(long creationMillis)
          Minimal constructor for aggregating subclasses.
 
Method Summary
protected  boolean equals(HeapInfo other)
           
 boolean equals(java.lang.Object other)
           
 float getGrowthRate()
           
 int getNumberOfInstances()
           
 long getSizeOfInstances()
           
 long getTime()
           
abstract  int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

numInstances

protected int numInstances

size

protected long size

growthRate

protected float growthRate
Constructor Detail

HeapInfo

protected HeapInfo(int numInstances,
                   long size,
                   float growthRate,
                   long creationMillis)
Full state constructor.

Parameters:
numInstances - the total number of instances of this type
size - the total amount of heap memory used by all instances of this type, in bytes
growthRate - the rate at which heap usage of this type increases, in bytes per second
creationMillis - timestamp for when this IHeapInfo was calculated

HeapInfo

public HeapInfo(long creationMillis)
Minimal constructor for aggregating subclasses.

Parameters:
creationMillis - timestamp for when this IHeapInfo was calculated
Method Detail

getGrowthRate

public float getGrowthRate()
Specified by:
getGrowthRate in interface IHeapInfo
Returns:
the growth rate in bytes per second.

getNumberOfInstances

public int getNumberOfInstances()
Specified by:
getNumberOfInstances in interface IHeapInfo
Returns:
the number of live instances that this IHeapInfo represents.

getSizeOfInstances

public long getSizeOfInstances()
Specified by:
getSizeOfInstances in interface IHeapInfo
Returns:
the total size in bytes that this IHeapInfo represents.

getTime

public long getTime()
Specified by:
getTime in interface IHeapInfo
Returns:
the timestamp in milliseconds for when this IHeapInfo was created.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public abstract int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

equals

protected boolean equals(HeapInfo other)
Parameters:
other - an HeapInfo
Returns:
true iff other represent a HeapInfo with the same growth rate, number of instances and size of instances.
See Also:
Object.equals(Object)


Copyright © 1999, 2011, Oracle and/or its affiliates. All rights reserved.