GapContent buffer memory leak and performance degradation [was #7482]
{color:red}
reported by [~wissenbach] at 2008-01-11
previously known as [trac#21|http://www.textgrid.de/trac/ticket/21] {color}
In GapContent, Positions are created. A Position represents a point in the document that is shifted around when insertions/deletions in happen.
These Positions can never be removed, but are continuously created by AbstractBlockBox constructor. Thus, lots of Positi-
ons are added each time a Box is relayouted (i.e you insert anything).
This eats up memory and CPU Power.
Solutions: Either add a way to unregister Positions with GapContent, or do not create them in frequently generated Objects like ABB (DOM should be fine, since that is generated only once).
Quick fixed by using the Swing GapContent buffer. (This one uses weak references to get rid of unused positions)
Drawback: vex now relays on a couple of swing classes.