commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gregor Zeitlinger" <gre...@zeitlinger.de>
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
gregor@zeitlinger.de

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message