 <p>It's a big urban legend in the Java world that calling System.gc() will actually, reliably do something for you. It won't.</p> <p>It is a mere suggestion that the JVM attempt to do something. The <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/System.html#gc()" rel="nofollow noreferrer">Javadoc for the method</a> is purposefully ambiguous in this regard. </p> <p>The other big bugbear is nulling references. When a reference goes out of scope, it is already nulled by the VM, doing that yourself is redundant and misleading. If there are other references still around, they will still be available and your assignment will do nothing (unless you go and visit every other reference available -- but then, what's the point? that's what the VM is already doing).</p> <p>So to answer your questions:</p> <ul> <li>Setting attributes to null rarely makes sense. Design your software properly, so that references go out of scope when you're no longer using them.</li> <li>Calling System.gc() rarely makes sense. Let the JVM do the work for you -- that's why we use a VM instead of managing our own memory.</li> <li>Yes, let the VM manage your memory, it will GC when it needs to. However, if you've got poorly designed software, it can defeat the GC in the VM. In this case, track down your memory leaks and refactor the software (easier said than done, though).</li> </ul>