On Jan 11, 2007, at 10:02, [EMAIL PROTECTED] wrote:
Andreas L Delmelle writes:
I'd say the 80K ArrayLists are simply the childNodes lists of all
those FObj (TableCells and Blocks), and that those are, in most
cases, lists of only one element.
This is correct - for most instances,
Which brings us to another important piece of information that would
be interesting to know: how big are each of those instances?
Note that our ArrayLists are all created using the default
constructor (here and there, you'll find a few where an
initialCapacity is supplied). If the majority of those lists contain
only one element, there will still be backing Object arrays of 10
elements (9 out of 10 references remain null).
If we'd implement our own FONodeList() and supply it with a compact()
method to shrink the backing array to the size that is needed to
store all childNodes, and make sure this method is called upon in
endOfNode() when all children are known. This might again save a few...
Rough calculation, supposing 4 Bytes needed for each empty reference:
(80K x (4 x 9)) Bytes ~ 2.8 MB wasted on nulls, IIC.
Cheers,
Andreas