32-bit | 64-bit | |
---|---|---|
Object | 8 | 16 |
Integer | 16 | 24 |
Long | 16 | 24 |
Float | 16 | 24 |
Double | 16 | 24 |
String | 40 | 64 |
Date | 24 | 32 |
Calendar | 432 | 544 |
byte[0] | 16 | 24 |
byte[32] | 48 | 56 |
byte[128][0] | 2576 | 4120 |
ArrayList<Integer>(1) | 56 | 96 |
ArrayList<Integer>(2) | 80 | 128 |
Friday, March 14, 2008
It gets worse
Yesterday, I described my surprise at learning the true sizes of various Java Objects. What I didn't mention is that the sizes I was looking at were for a 32-bit JVM. Later yesterday, I tested out the same code on a 64-bit JVM. Egad. It gets worse. Sizes for various Java Objects:
Subscribe to:
Post Comments (Atom)
2 comments:
Sizes are all in bytes?
Yes, the sizes are all in bytes.
Post a Comment