This appendix contains a list of in-memory sizes of datatypes used by JamaicaVM
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
| Datatype | Memory size | Min Value | Max Value |
|---|---|---|---|
| boolean | 1 bit | false | true |
| byte | 8 bits (1 byte) | -128 (=-2^7) | 127 (=2^7-1) |
| short | 16 bits (2 bytes) | -32768 (=-2^15) | 32767 (=2^15-1) |
| char | 16 bits (2 bytes) | '\u0000' | '\uffff' |
| int | 32 bits (4 bytes) | -2147483648 (=-2^31) | 2147483647 (=2^31-1) |
| long | 64 bits (8 bytes) | -9223372036 854775808 (=-2^63) | 92233720368 54775807 (=2^63-1) |
| float | 32 bits (4 bytes) | 1.4E-45F | 3.4028235E38F |
| double | 64 bits (8 bytes) | 4.9E-324 | 1.7976931348 623157E308 |
| Java reference | 32 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 heap | 32 bytes | ||
| Minimum Java array size on heap | 32 bytes | ||
| Minimum size of single heap memory chunk | 64KB | ||
| 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 method | 4 slots | ||
| Java stack frame of synchronized method | 5 slots | ||
| Java stack frame of static initializer | 7 slots | ||
| Java stack frame of asynchronously interruptible method | 8 slots | ||
| Additional Java stack frame data in -profile mode. | +2 slots |