[PEAK] Re: [TransWarp] releasing component subtrees
alex at ank-sia.com
Tue Oct 21 14:18:49 EDT 2003
Phillip J. Eby wrote, at 21.10.2003 18:45:
>> our application from time to time is runnung tasks that should die
>> after doing their job. but my colleague found that the dead tasks
>> remain in memory because of circular references between parent and
>> child components that are not detected by python gc.
> Python doesn't do GC on objects that have __del__ methods. If you get
> rid of the __del__ method in your example, the GC should run.
thank you. it appears that nobody of our python programmers knew that.
> There's an easier way, at least for your example. Declare your 'task1'
> and 'task2' bindings as 'noCache=True'.
i am sorry, i cannot figure out how to use 'noCache'. everything i try
in this example ends up with the same result: 'task1' and 'task2' stop
reporting their creation and run.
could you show an example of 'noCache' use?
>> below is a simple example. it creates a task with two subtasks. each
>> of these tasks terminates as soon as it is run. no reference is kept
>> to the container task,
> Not true; every component has a reference to its parent; that's how they
> find their parents.
of course. i meant that no reference is kept outside the subtree in
question. sorry for being imprecise.
More information about the PEAK