[Twisted-Python] MemoryError in twisted.internet.abstract.FileDescriptor
Augusto Mecking Caringi
augustocaringi at gmail.com
Sat Dec 10 10:25:59 MST 2011
On Fri, Dec 9, 2011 at 7:31 PM, Itamar Turner-Trauring
<itamar at itamarst.org> wrote:
>> What's the best solution? Apply the patch attached on this ticket,
>> moving to a producer/consumer approach, or any other idea?
>
> The patch will just delay the problem... you're creating a huge number of
> strings, faster than the transport can write them out. The solution is
> indeed to use the consumer API to pause creation of more data until the
> transport clears its buffers.
Right, I will try with the consumer API.
But I have one last question:
In my previous example, the memory usage grows until a MemoryError exception.
But other scenario is when my "event send loop" iterates a high number
of times (but not enough to raise a exception) and then stops.
I expected that when the loop ends, all the strings would be flushed
and as a consequence, the memory usage of the process would return to
a normal level. But this does not happen... It's normal?
Thanks!
--
Augusto Mecking Caringi
More information about the Twisted-Python
mailing list