Appendix E. Datatypes

This appendix contains a list of in-memory sizes of datatypes used by JamaicaVM

JamaicaVM Datatype Sizes

For datatypes that are smaller than one machine word, only the actual number of bits required will be occupied for the value. I.e., several values of types boolean, byte, short and char may be packed into a single machine word when stored in an instance field or an array.

Table E-1. JamaicaVM datatype sizes

DatatypeMemory sizeMin ValueMax Value
boolean1 bitfalsetrue
byte8 bits (1 byte)-128 (=-2^7)127 (=2^7-1)
short16 bits (2 bytes)-32768 (=-2^15)32767 (=2^15-1)
char16 bits (2 bytes)'\u0000''\uffff'
int32 bits (4 bytes)-2147483648 (=-2^31)2147483647 (=2^31-1)
long64 bits (8 bytes)-9223372036 854775808 (=-2^63)92233720368 54775807 (=2^63-1)
float32 bits (4 bytes)1.4E-45F3.4028235E38F
double64 bits (8 bytes)4.9E-3241.7976931348 623157E308
Java reference32 bits (4 bytes)null-
Object header (contains garbage collection state, object type, inlined monitor and memory area)12 bytes  
Array header (contains object header, array layout information and array length)16 bytes  
Minimum Java object size on heap32 bytes  
Minimum Java array size on heap32 bytes  
Minimum size of single heap memory chunk64KB  
Garbage Collector data overhead for heap memory (for a usable heap of a given size, the garbage collector will allocate this percentage of additional memory for its data).6.25%  
Java stack frame of normal method4 slots  
Java stack frame of synchronized method5 slots  
Java stack frame of static initializer7 slots  
Java stack frame of asynchronously interruptible method8 slots  
Additional Java stack frame data in -profile mode.+2 slots