[self-interest] Re: Scientific experiment

Jecel Assumpcao Jr jecel at lsi.usp.br
Thu Jun 24 21:45:06 UTC 1999


Douglas Atique wrote:
> 
> Ain't this a bit strange? I mean, if I (a Self programmer) remove all references to
> an object (and I guess for us Self programmers the lobby is THE root) by removing
> it from the lobby, shouldn't the VM garbage collect the object?

The lobby is the central object from the Self programmer's viewpoint,
but the virtual machine needs to know all those listed by Mario in
order to work properly (how can a boolean primitive return true or
false if it doesn't have a pointer to these two objects?). And if
the VM knows about these objects, they can never become garbage no
matter what.

> I am concerned with
> whether this can cause memory to fill up unnecessarily while the programmer thinks
> (s)he did remove the object from memory. On the other hand, I know that many
> objects not referenced by the lobby (thus anonymous) are usable from the graphical
> environment, even though not very easily in the text prompt.

That is why we have automatic garbage collection: so if the
programmer thinks an object is no longer needed but is wrong we
don't create a very hard to find bug!!

About the anonymous graphic objects, I have already explained
that they are referenced by the lobby. They are anonymous simply
because no slot has been declared as their creator.

> This makes me think of
> another issue. When Self programmers had only the text prompt, did it make sense to
> have anonymous objects? What is the connection among all this stuff? I hope to be
> clear in my meaning.

In the GUI an object doesn't have to have a name - you can refer
to it by pointing with the mouse and calling up a menu. There is
no way to do something like that at the text prompt, so Self
includes a list of the last hundred objects (more or less) that
have been printed out somehow. That is what the objectIDArray is
all about.  You can retrieve one of those objects by an expression
like '12 _AsObject' which will simply return the object at index
12 in objectIDArray. When the array fills up, the earliest entries
are thrown away (I think). So this is another place that can hold
on to an object and keep it from being garbage collected.

-- Jecel


------------------------------------------------------------------------

eGroups.com home: http://www.egroups.com/group/self-interest
http://www.egroups.com - Simplifying group communications






More information about the Self-interest mailing list