[PEAK] peak.events fixes (was Re: memory leaks & stuff)

Phillip J. Eby pje at telecommunity.com
Thu Sep 23 17:13:28 EDT 2004


At 03:22 PM 9/15/04 -0400, Phillip J. Eby wrote:
>At 10:08 PM 9/15/04 +0300, alexander smishlajev wrote:
>>Yaroslav Samchuk wrote, at 14.09.2004 20:52:
>>
>>>On the last week we had discovered, that the application, which is
>>>developed by our team was leaking memory.
>>
>>that's it.  the memory is leaking with nested AnyOf()s when the inner one 
>>does not include a _Sleeper.  the following script leaks memory with i/o 
>>events and Observable (or any derivatives), unless the the inner AnyOf 
>>includes eventLoop.sleep()
>
>AnyOf releases its references to other events once it has fired, so the 
>problem is that the various nested AnyOf's with events that don't fire, 
>are not getting garbage collected.
>
>It seems the natural fix for this would be to make AnyOf automatically 
>"flatten" any nested AnyOf's into itself, so that there is never such a 
>thing as a nested AnyOf.  I'll try to implement this along with the other 
>changes I've mentioned for events.  (i.e., retaining socket and signal 
>events whenever they callbacks active, rather than using weak references 
>exclusively.)

I've now fixed these issues (AnyOf, subscribe, select, and signals):

http://www.eby-sarna.com/pipermail/source-changes/2004q3/001815.html

If these changes do not allow you to safely remove your workarounds, please 
let me know.  Thanks.




More information about the PEAK mailing list