You Are Here:

Community: Developer Discussion Boards

#1 Old Angry Humongous leaks in appuifw.Listbox?? - 2009-07-05, 23:18

Join Date: Apr 2008
Posts: 55
sadysta
Offline
Regular Contributor
Consider this:
Code:
import appuifw
import e32

if __name__ == '__main__':
    items = [u'test'] * 100
    while True:
        listbox = appuifw.Listbox(items)
        appuifw.app.body = listbox
        e32.ao_yield()
It is my understanding that this code shouldn't produce any memory leaks. listbox is local, appuifw.app.body gets overwritten in every iteration... so the reference counting magic seems fine to me... Then perhaps somebody could explain to me why this code produces about 1MB of memory leak per second (monitored using JBakTaskman) causing python interpreter to terminate after about 20secs???

This is just a test case. I have a real life application that suffers from this sort of memory leaks. The same happens on Python 1.4.5 and Python 1.9.5 and 1.9.6, tested on Nokia E75. If there's a different control instead of a Listbox there's no leak. Please share any information you can (but keep in mind that I've googled a bit so I've heard about Listbox + icons problem, this is not my case - I'm not using any icons).
Reply With Quote

#2 Old Re: Humongous leaks in appuifw.Listbox?? - 2009-07-06, 08:26

Join Date: Apr 2009
Posts: 65
nirpsis
Offline
Regular Contributor
Weird! You found a memory leak

I confirm the leak on 1.9.6 SDK, it works for me atleast for a minute before crashing. I wonder if it happens with standalone applications too?

Would if help if the heap size was increased?

I tried this similar code and it worked for sometime more,

Code:
import appuifw
import e32

if __name__ == '__main__':
    items = [u'test'] * 100
    while True:
        listbox = appuifw.Listbox(items)
        appuifw.app.body = listbox
        e32.ao_sleep(0.1)
I think we should log this as a bug!


--NirpSis

http://sites.google.com/site/nirpsis/
http://nirpsis.blogspot.com/
Reply With Quote

#3 Old Re: Humongous leaks in appuifw.Listbox?? - 2009-07-06, 11:24

Join Date: Apr 2008
Posts: 55
sadysta
Offline
Regular Contributor
Where should I report this?
Reply With Quote

#4 Old Re: Humongous leaks in appuifw.Listbox?? - 2009-07-07, 06:46

Join Date: Sep 2005
Posts: 314
Location: Finland, Helsinki
aaaaapo
Offline
Regular Contributor
Quote:
Originally Posted by sadysta View Post
Where should I report this?
Bug reports for

1.9.x:
https://garage.maemo.org/tracker/?at...54&func=browse

1.4.x:
http://sourceforge.net/tracker/?grou...55&atid=790646


--
Aapo Rista
http://code.google.com/p/pys60gps/
http://opennetmap.org/
Reply With Quote

#5 Old Re: Humongous leaks in appuifw.Listbox?? - 2009-07-08, 01:37

Join Date: Nov 2007
Posts: 117
raf1hh
Offline
Regular Contributor
I have run into this on 1.4.5. I believe what worked for me is something like this:
Code:
import appuifw
import e32

if __name__ == '__main__':
    items = [u'test'] * 100
    while True:
        listbox = appuifw.Listbox(items)
        appuifw.app.body = listbox
        del listbox
        listbox = None
        e32.ao_yield()
Although my code was structured differently and the listbox variables where class fields. Also, items has a different scope than listbox and it might be causing some issues.

Btw, I'm not justifying the bug just trying to give you a workaround until the bug is fixed ;-)
Last edited by raf1hh : 2009-07-08 at 01:40. Reason: Fix
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Detecting Memory Leaks amalshah73 Mobile Java General 9 2009-05-21 16:10
Leaks in the CSmlDmAdapter. dr_rost General Symbian C++ 1 2009-05-01 21:56
Just wanted to share the info about memory leaks yajuvendra General Symbian C++ 0 2006-03-29 14:45
Memory leaks ManishPatil General Symbian C++ 0 2004-12-09 12:55
Memory Leaks abhishekmishra General Symbian C++ 1 2002-08-21 16:44

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia