|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.iapi.services.cache.ClassSize
public class ClassSize
Field Summary | |
---|---|
private static int |
booleanSize
|
private static java.util.Hashtable |
catalog
|
private static int |
charSize
|
private static int |
doubleSize
|
private static boolean |
dummyCatalog
|
private static int |
floatSize
|
private static int |
intSize
|
private static int |
longSize
|
private static int |
minObjectSize
|
(package private) static boolean |
noGuess
|
private static int |
objectOverhead
|
static int |
refSize
|
private static int |
shortSize
|
(package private) static boolean |
unitTest
|
private static int[] |
wildGuess
|
Constructor Summary | |
---|---|
ClassSize()
|
Method Summary | |
---|---|
static int |
estimateAndCatalogBase(java.lang.Class cls)
Estimate the static space taken up by a class instance. |
static int |
estimateArrayOverhead()
|
static int |
estimateBase(java.lang.Class cl)
Estimate the static space taken up by the fields of a class. |
static int |
estimateBaseFromCatalog(java.lang.Class cls)
Estimate the static space taken up by a class instance from cataloged coefficients. |
private static int |
estimateBaseFromCatalog(java.lang.Class cls,
boolean addToCatalog)
|
static int |
estimateBaseFromCoefficients(int[] coeff)
Estimate the static space taken up by a class instance given the coefficients returned by getSizeCoefficients. |
static int |
estimateHashEntrySize()
Estimate the size of a Hashtable entry. |
static int |
estimateMemoryUsage(java.lang.String str)
Estimate the size of a string. |
private static int |
fetchRefSizeFromSystemProperties()
Tries to determine the reference size in bytes by checking whether the VM we're running in is 32 or 64 bit by looking at the system properties. |
static int |
getIntSize()
|
static int |
getRefSize()
Get the estimate of the size of an object reference. |
static int[] |
getSizeCoefficients(java.lang.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. |
private static java.lang.String |
getSystemProperty(java.lang.String propName)
Attempts to read the specified system property. |
static void |
setDummyCatalog()
do not try to use the catalog. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int refSize
private static final int objectOverhead
private static final int booleanSize
private static final int charSize
private static final int shortSize
private static final int intSize
private static final int longSize
private static final int floatSize
private static final int doubleSize
private static final int minObjectSize
private static boolean dummyCatalog
static boolean noGuess
static boolean unitTest
private static final int[] wildGuess
private static java.util.Hashtable catalog
Constructor Detail |
---|
public ClassSize()
Method Detail |
---|
public static void setDummyCatalog()
public static int getRefSize()
public static int getIntSize()
public static int[] getSizeCoefficients(java.lang.Class cl)
cl
- A class whose instance size is to be estimated
public static int estimateBaseFromCoefficients(int[] coeff)
coeff
- the coefficients
public static int estimateBaseFromCatalog(java.lang.Class cls)
cls
- the class
estimateBaseFromCoefficients(int[])
,
see org.apache.derbyBuild.ClassSizeCrawler
private static int estimateBaseFromCatalog(java.lang.Class cls, boolean addToCatalog)
public static int estimateAndCatalogBase(java.lang.Class cls)
cls
- the class
estimateBaseFromCoefficients(int[])
,
see org.apache.derbyBuild.ClassSizeCrawler
public static int estimateBase(java.lang.Class cl)
estimateBaseFromCatalog(java.lang.Class)
public static int estimateArrayOverhead()
public static int estimateHashEntrySize()
public static int estimateMemoryUsage(java.lang.String str)
private static final int fetchRefSizeFromSystemProperties()
-1
if the reference size couldn't be determined.private static final java.lang.String getSystemProperty(java.lang.String propName)
propName
- name of the system property to read
null
if it doesn't exist or the
required permission to read the property is missing.
|
Built on Thu 2012-03-29 21:53:33+0000, from revision ??? | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |