Re: garbage collection
jon klein <[email protected]>
| Newsgroups | gmane.comp.breve |
|---|---|
| Message-ID | <[email protected]> |
On Apr 3, 2004, at 11:47 PM, Rick Giuly wrote:
> There must be something wrong with the breve's ability to free memory.
> The following code will run all the way up to 100megs of memory usage.
>
> for i=0, i<200000, i+=1: {
> a = new Shape.
> free a.
> }
When an object is freed in breve, it is not garbage collected at that
very instant. It is marked for deletion, and then officially removed
at the end of the timestep.
In a language like C, you would expect code like that to never have
more memory allocated than the size of "Shape". In breve, on the
other hand, the memory will start low, climb to 200000 * (the size
of shape), and then drop again after the next iteration step.
So when I run this test, I do see the memory surge up very high --
but then I also see it (eventually) go back down again. So while
this is an inconvenience, I don't think it's actually a leak.
- jon klein
_______________________________________________
breve mailing list
[email protected]
http://www.spiderland.org/mailman/listinfo/breve