at.spardat.xma.mdl
Class MemoryEstimator

java.lang.Object
  extended byat.spardat.xma.mdl.MemoryEstimator

public class MemoryEstimator
extends java.lang.Object

Provides some utility method to estimate the memory consumption of java objects.


Constructor Summary
MemoryEstimator()
           
 
Method Summary
static int sizeOf(java.lang.String s)
          Returns the number of bytes a String consumes if it is not shared with other Strings.
static int sizeOfObject(int numInstances)
          Returns the number of bytes an java objects consumes that has numInstances instance variables.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemoryEstimator

public MemoryEstimator()
Method Detail

sizeOfObject

public static int sizeOfObject(int numInstances)
Returns the number of bytes an java objects consumes that has numInstances instance variables. Thats the size of the object itself, without complex instance variables.


sizeOf

public static int sizeOf(java.lang.String s)
Returns the number of bytes a String consumes if it is not shared with other Strings.