commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gregor Zeitlinger" <>
Subject [collections] WeakArrayList
Date Sun, 29 Oct 2006 16:06:47 GMT
I recently had a severe memory leak because more listeners were added
to a listener list than removed.
I solved the problem by adding only WeakReferences and compacting the
list in a separate thread. CursorableLinkedList has a similar solution
for cursors - except that the cursors are not cleaned up in a separate
thread (which is better, now that I'm thinking about it).

So what I suggest is a list where the entries are stored in weak
references and auto-cleaned like the cursors in CursorableLinkedList.
No more removeListener - which is silly anyways.

Gregor Zeitlinger

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message