[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Disposing object instances



By definition, an object is only garbage when there is no way to reference
it.  If you had the ability to "mark it as garbage" when you still retained
references to it, you would almost surely get bizarre errors when some
other part of your program followed those references.

Usually, you just need to be sure that you are not keeping things like
history lists to make sure that it's easy to actually forget stuff you no
longer want to remember.  MCL has "weak" hash tables that even allow you to
implement stuff like this easily.

What sort of code are you writing that keeps references to things you no
longer need and causes you to run out of room?

--Pete Szolovits