Memory Leaks in Java
Wednesday, July 16th, 2008[java]public class MyClass { private ArrayList list = new ArrayList(); public void addFoo( Object foo ) { list.add( foo ); } public void processFoo( Object foo ) { // Get foo out of the list Object fooRef = list.get( foo ); // Do something with fooRef ... // Done with fooRef, destroy it fooRef = null; } }[/java] In this example, the addFoo() ...