The Artima Developer Community
Sponsored Link

Legacy Design Forum
Finalization and Cleanup

Advertisement

Advertisement

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 Artima Forums.

Message:

I've had the same problem...

Posted by Evan Simeone on May 05, 1999 at 8:28 AM

My program was suffering from the same problem. I was also forced to give all my classes a "releaseAll()" method which was essentially the same as your "prepareForGC()." The problem is that it makes the code inflexible. If I change data members in any way, I have to make sure I go and change the classes' releaseAll() methods. I think the response that has been posted has missed the fact that many (conservative) garbage collectors can't handle circular references. This forces the programmer to worry to much about freeing memory. If I wanted to do that, I'd be coding C++.

Does anybody out there have a straight forward appraoch to solving this problem?

Thanks,

--Evan



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us