On Mon, 23 Jan 2006 00:38:50 -0800 Justin <[EMAIL PROTECTED]> wrote: > Hi all, > > I've been working on a paging world system in soya that will allow me to > create very large "continuous" worlds with objects and landscapes being > created and deleted on the fly. The problem is, it looks like my objects > (right now only soya.Land objects..) aren't actually being deleted. I've > verified that they've been removed from the scene World, and that I'm > not holding any references to them, but they still don't seem to be > getting garbage collected. Watching my process's memory size shows it > going up and up, even though the number of Land objects in the scene is > staying the same. > > Is there some internal collection in soya that's holding on to > references to these objects? Or some other reason they might not be > getting gc'd? (gc.garbage doesn't show anything, so it doesn't look like > a circular reference __del__ problem...)
There is no internal collection for Land ; although there are some for shapes and materials, thus if your Lands use different materials and textures, it may be the material that consume memory. Due to circular references, the deletion of a Land may not occur immediately but at the next (or maybe the second next) garbage collection. You can force it by calling gc.collect() twice. You can use weakref to track your Land : create a ref to it, and then check whether the Land is dead or not. Jiba
