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:
32-bit64-bit
Object816
Integer1624
Long1624
Float1624
Double1624
String4064
Date2432
Calendar432544
byte[0]1624
byte[32]4856
byte[128][0]25764120
ArrayList<Integer>(1)5696
ArrayList<Integer>(2)80128

2 comments:

JS said...

Sizes are all in bytes?

Pussinboots said...

Yes, the sizes are all in bytes.