| java.lang.Object org.apache.derby.iapi.services.cache.ClassSize
ClassSize | public class ClassSize (Code) | | |
Method Summary | |
public static int | estimateAndCatalogBase(Class cls) Estimate the static space taken up by a class instance. | public static int | estimateArrayOverhead() the estimated overhead of an array. | public static int | estimateBase(Class cl) Estimate the static space taken up by the fields of a class. | public static int | estimateBaseFromCatalog(Class cls) Estimate the static space taken up by a class instance from cataloged coefficients. | public static int | estimateBaseFromCoefficients(int[] coeff) Estimate the static space taken up by a class instance given the coefficients
returned by getSizeCoefficients. | public static int | estimateHashEntrySize() Estimate the size of a Hashtable entry. | public static int | estimateMemoryUsage(String str) Estimate the size of a string. | public static int | getIntSize() | public static int | getRefSize() Get the estimate of the size of an object reference. | public static int[] | getSizeCoefficients(Class cl) The estimate of the size of a class instance depends on whether the JVM uses 32 or 64
bit addresses, that is it depends on the size of an object reference. | public static void | setDummyCatalog() do not try to use the catalog. |
noGuess | static boolean noGuess(Code) | | |
refSize | final public static int refSize(Code) | | |
unitTest | static boolean unitTest(Code) | | |
estimateArrayOverhead | public static int estimateArrayOverhead()(Code) | | the estimated overhead of an array. The estimated size of an x[n] array isestimateArrayOverhead() + n*sizeOf(x). |
estimateBase | public static int estimateBase(Class cl)(Code) | | Estimate the static space taken up by the fields of a class. This includes the space taken
up by by references (the pointer) but not by the referenced object. So the estimated
size of an array field does not depend on the size of the array. Similarly the size of
an object (reference) field does not depend on the object.
the size estimate in bytes.Note that this method will throw a SecurityException if the SecurityManager does notlet this class execute the method Class.getDeclaredFields(). If this is a concern tryto compute the size coefficients at build time.see org.apache.derbyBuild.ClassSizeCrawler See Also: ClassSize.estimateBaseFromCatalog |
estimateBaseFromCoefficients | public static int estimateBaseFromCoefficients(int[] coeff)(Code) | | Estimate the static space taken up by a class instance given the coefficients
returned by getSizeCoefficients.
Parameters: coeff - the coefficients the size estimate, in bytes |
estimateHashEntrySize | public static int estimateHashEntrySize()(Code) | | Estimate the size of a Hashtable entry. In Java 1.2 we can use Map.entry, but this is not
available in earlier versions of Java.
the estimate, in bytes |
estimateMemoryUsage | public static int estimateMemoryUsage(String str)(Code) | | Estimate the size of a string.
the estimated size, in bytes |
getIntSize | public static int getIntSize()(Code) | | the estimate of the size of a primitive int |
getRefSize | public static int getRefSize()(Code) | | Get the estimate of the size of an object reference.
the estimate in bytes. |
getSizeCoefficients | public static int[] getSizeCoefficients(Class cl)(Code) | | The estimate of the size of a class instance depends on whether the JVM uses 32 or 64
bit addresses, that is it depends on the size of an object reference. It is a linear
function of the size of a reference, e.g.
24 + 5*r
where r is the size of a reference (usually 4 or 8 bytes).
This method returns the coefficients of the linear function, e.g. {24, 5} in the above
example.
Parameters: cl - A class whose instance size is to be estimated an array of 2 integers. The first integer is the constant part of the function,the second is the reference size coefficient. |
setDummyCatalog | public static void setDummyCatalog()(Code) | | do not try to use the catalog.
|
|
|