This page contains an archived post to the Design Forum (formerly called the Flexible Java Forum) made prior to February 25, 2002.
If you wish to participate in discussions, please visit the new
If I know that will no longer be using an object, does the setting of member variable references to null faciliate garbage collection in any way? For example if I know that I am done with Object A and A implements a dispose() method that "cleans up" or sets all references to null, does this impact garbage collection in any way? Based upon my reading I would think it would be difficult, if not impossible, to know if this really has any impact on GC - since each VM may implement GC differently.