[jdom-interest] About JDOM performance
jhunter at collab.net
Tue May 22 15:18:23 PDT 2001
phil at triloggroup.com wrote:
> In fact, the memory overhead for an object is something like 30
> bytes, depending on the JVM.
> The size for a 100,000 items in a linked is approximatly
> 100000*(30+4*3)=4,200,000 bytes, regarding less the entry
> itself. On the over hand, the array list, in the worst case, is
> 150,000*4=600,000 bytes => 7 times lower !! The only
> drawback is that memory must be contiguous. But this is not a
> constrainy under Win32 since the memory is logically
> contiguous but allocated in blocks.
> Also note that creating plenty of LinkedList.Entry objects
> stress the garbage collector.
> I will definitively remove the LinkedLists from my own JDOM
> sources and replace them by ArrayLists.
Phil, seems you have a compelling argument for why we should use
ArrayList always. Anyone have a counter?
Jools, does this have a profound effect on your next-gen list work?
Might make it easier on you since you wouldn't have to manage a
singly-linked list. Perhaps you could just wrap/extend an ArrayList.
More information about the jdom-interest