
23 Nov
2009
23 Nov
'09
9:21 p.m.
Mark Burton schrieb:
As the object sizes are rounded to multiples of 8, it looks like a case of buy one, and get 7 for free!
Yes, just tried that and the same amount of memory is used for 1 boolean and 8 booleans.
...
Yes, but if you only have 1 boolean in the class with the ints it still uses 336 bytes. So you get 7 for free! If you add no booleans to the class, the size is 328. So I guess that's why they say that some people think the class is half empty while the others say that the class is half full!
Yes, you' re right. I missed the fact that 1 boolean needs the same space as 8 booleans. So you get indeed 7 for free. Thanks for clarifying.