[virtmach] garbage collection
thaddaeus.frogley@creaturelabs.com
thaddaeus.frogley@creaturelabs.com
Thu, 18 May 2000 17:43:03 +0100
>> The way I see it, if 'n' isn't on the untyped stack then no references to
>> object 'n' exist, then it can be removed from the polymorphic repository.
>
> You can use the VM stack as your initial root set (assuming that you
> have a compatible treatment for the global environment), but the stack
> won't contain all object references (unless your VM can't have nested
> objects).
The VM I'm working on doesn't have a heap as such, only a stack, and the
"polymophic repository" contains what can be best described as handles to
database records, so nested objects aren't an issue (which makes *what* and
*how* easy, the real question, for me, is *when* ).
The issue is when the "database" scales up and somebody decides to write an
agent that iterates through a large portion of it.
>> (I don't actually think I'm going to need this, I interested in ways it
>> could be done if I did...)
>
> Unless you've got explicit allocation/deallocation operators (or a
> very clever compiler that does region/lifetime analysis), you need GC
> of some form. The question is at what level of complexity.
Actually the lifetime of agent behaviours is so short that I think I'm going
to get away without it, just by waiting for the agent to finish and dumping
everything when its done.
(When I say short I mean, thousands execute atomically every second.)
Thanks for the references David, and Bart.
Thad