[jboss-dev-forums] [Design of JBossCache] - Re: JBCACHE-1154 - Introduce ability to mark nodes as reside

jason.greene@jboss.com do-not-reply at jboss.com
Tue Sep 4 13:23:49 EDT 2007


"mircea.markus" wrote :  an boolean is hold on a bit. An RegularEnumSet aggregates an long (64 bit) + some caching arrays (other bits as well). From a memory POV it is optimal to aggregate booleans directly (than EnumSets wrapping enums). 
  | 

A boolean is sizeof(unsigned char) which is a byte on every platform I know of. An array reference is the size of a pointer, so typically 32 or 64bit. There are 2. So when accounting for the reference to the EnumSet itself, on a 32 bit architecture you need more than 20 booleans to exceed the space utilization of an enumset with 64 or less Enums. 

java.util.BitSet uses slightly less space than EnumSet (1 array ref + 1 32 bit value).

That said, any efficiency gain here is neligable, so we should be focusing on what best fits the design. 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4081002#4081002

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4081002



More information about the jboss-dev-forums mailing list