posted 23 years ago
Hi Matthew
As the previous answer says, if there are no other active references to the ArrayList in question, set its reference to null and it will become eligible for garbage collection.
However, I get the feeling that you wish to clean up all the objects contained within the ArrayList. In order to make these objects eligible for garbage collection, you need to ensure that there are no other active references to them in other parts of the program. If there are, simply calling <code>clear()</code> on the ArrayList and then setting it to null will NOT result in the objects it contained becoming eligible for garbage collection. Although the memory used by the ArrayList object may be reclaimed, the memory used by the objects that the ArrayList contained will still be in use. So be careful.
Hope this helps
Michael
------------------
"One good thing about music - when it hits, you feel no pain"
Bob Marley
"One good thing about music - when it hits, you feel no pain" <P>Bob Marley