Artur Biesiadowski abies at
Mon May 3 13:51:25 PDT 1999

Maxim Kizub wrote:

> PS BTW, will it allow to allocate boolean fields in one bit? I've
> noticed,
> that swing components have a lot of boolean fields, and packing them
> should save some memory for swing apps.

Such change would not only cover jit, also class layout. Remember that
memory would be saved only in case in which few boolean fields would
appear in same class - superclass ones cannot be merge with subclass
ones. I doubt if it would save any memory at all. How many swing objects
do you have in memory at once ? 100 ? 1000 ? Even with saving of 3 bytes
per instance (I DOUBT if it is possible to achieve such saving - there
are really not so many boolean vars in swing), you will get 3k of saved
space. What is the cost ? You need to add few instuctions in code to
extract bit info (shift, mask).

If we want to save space, it is better to try to make String smaller, or
change Hashtable from bucket based to list based (I'm not sure what it
is called in english - I think about resolving hash collisions by
seeking next indexes instead of creating llists). Instances of GUI
components are not the major problem here.


More information about the kaffe mailing list