Hi,

Further to this, I designed a shorter test...

def Test3(idx):
  logging.debug("GC TRACKING %d OBJECTS" % len(gc.get_objects()))
  area = ui.get_cols_rows()
  content = Filler(Text("THIS IS A TEST STRING %10d" % idx, align="center"))
  ui.draw_screen(area, content.render(area))
  sleep(0.50)

Which still leaks by default. But, setting no cache rendering on stops
the leak, so I suspect that the caching code is hanging on to widgets.
Now to find out how to flush the cache...

On Thu, Jun 5, 2008 at 6:00 PM, <[EMAIL PROTECTED]> wrote:
>
> Send Urwid mailing list submissions to
>        [email protected]
>
> To subscribe or unsubscribe via the World Wide Web, visit
>        http://lists.excess.org/mailman/listinfo/urwid
> or, via email, send a message with subject or body 'help' to
>        [EMAIL PROTECTED]
>
> You can reach the person managing the list at
>        [EMAIL PROTECTED]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Urwid digest..."
>
>
> Today's Topics:
>
>   1. Possible memory leak? (John Goodfellow)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 4 Jun 2008 20:44:06 +0200
> From: "John Goodfellow" <[EMAIL PROTECTED]>
> Subject: [Urwid] Possible memory leak?
> To: [email protected]
> Message-ID:
>        <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi Y'all,
>
> I have a long running text mode application (an Asterisk interface) which
> uses Urwid and Twisted. The library itself performs the functions I require,
> but I notice over time my little application consumes more and more memory.
>
> For my main call list window, I started out using a SimpleListWalker and
> switched to the default of the ListBox - the PollingListWalker which solved
> one leak, but then I observed that whenever I opened an additional window,
> objects accumulated which were not released. The Python version I have tried
> this on is 2.5.2 and the 2.5 generation from Debian Etch.
>
> I attach a sample which demonstrates the problem. Iterating using Test()
> produces the memory leak as more and more objects are tracked by the garbage
> collector but don't seem to be returned or collected and are yet not
> uncollectable. I created an alternative (Test2()) which simply allocates and
> then pops from a list. At the end of each procedure, the procedure's non
> externally referenced variables should be disposed, but the objects from
> Test() persist and grow.
>
> I am sure there must be a very simple explanation why this happens. Perhaps
> someone could explain it.
>
> Many thanks.
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: 
> http://lists.excess.org/pipermail/urwid/attachments/20080604/7941414a/attachment-0001.html
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: test3.py
> Type: text/x-python
> Size: 1340 bytes
> Desc: not available
> Url : 
> http://lists.excess.org/pipermail/urwid/attachments/20080604/7941414a/attachment-0001.py
>
> ------------------------------
>
> _______________________________________________
> Urwid mailing list
> [email protected]
> http://lists.excess.org/mailman/listinfo/urwid
>
>
> End of Urwid Digest, Vol 34, Issue 1
> ************************************
>


_______________________________________________
Urwid mailing list
[email protected]
http://lists.excess.org/mailman/listinfo/urwid

Reply via email to