Sven & Camillo,

Ok thanks.  And using the PointerFinder is there a way to know which of
the pointers points to the SystemDictionary or Object someObject or
whereever the GC begins so one would not have to check every pointer for
every stubborn object.

E.g. Lets say I've nil'ed the reference between the Navy and the ship so
its ready to go but a few of the soldiers on the ship have references to
other ships because their transfer papers weren't processed properly.
Running #pointersTo on those soldiers gives a large collection of
pointers.


How can I use the computer to filter that list to just those references
back to the root object?



Thanks for you help

Paul

On 06/26/2013 03:37 PM, Sven Van Caekenberghe wrote:
> Paul,
> 
> On 26 Jun 2013, at 23:47, Paul DeBruicker <pdebr...@gmail.com> wrote:
> 
>> Lets say I'm modeling a navy that is comprised of many ships each with
>> their own soldiers and jobs.  If I want one of the ships to be GC'd do I
>> need to implement #release in the soldier and job objects and send it to
>> each of those soldiers and jobs that live and work on the ship I want
>> GC'd or is removing the references between the ship and the navy enough
>> to have the whole ship (including its soldiers and jobs)  GC'd?
> 
> GC is automatic memory management. Whenever something is no longer reachable 
> by following pointers from a a know starting set, the system dictionary, the 
> stack and some other places, it automatically becomes garbage and the memory 
> it occupies will be reused.
> 
> Of course, if you keep a reference to an object, on purpose or by accident, 
> the object will never become garbage and it will keep on occupying memory. 
> Especially circular references can be hard to track.
> 
> There are indeed a couple of common messages that are sometimes used to break 
> possible references by nilling out instance variables etc. #close, #stop, 
> #unregister and indeed #release. Often, these are also used to manage 
> external resources (open files, sockets …). You can use any message to do 
> this, there is no framework that you have to follow.
> 
> And then there are also finalization and weak references, which are related, 
> but more advanced.
> 
> Sven
> 


Reply via email to