Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor sadysta's Avatar
    Join Date
    Apr 2008
    Posts
    55
    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).

  2. #2
    Regular Contributor nirpsis's Avatar
    Join Date
    Apr 2009
    Posts
    65
    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/

  3. #3
    Regular Contributor sadysta's Avatar
    Join Date
    Apr 2008
    Posts
    55
    Where should I report this?

  4. #4
    Regular Contributor aaaaapo's Avatar
    Join Date
    Sep 2005
    Location
    Finland, Helsinki
    Posts
    323
    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/

  5. #5
    Regular Contributor raf1hh's Avatar
    Join Date
    Nov 2007
    Posts
    147
    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 00:40. Reason: Fix

Similar Threads

  1. Detecting Memory Leaks
    By amalshah73 in forum Mobile Java General
    Replies: 9
    Last Post: 2009-05-21, 15:10
  2. Leaks in the CSmlDmAdapter.
    By dr_rost in forum Symbian C++
    Replies: 1
    Last Post: 2009-05-01, 20:56
  3. Just wanted to share the info about memory leaks
    By yajuvendra in forum Symbian C++
    Replies: 0
    Last Post: 2006-03-29, 13:45
  4. Memory leaks
    By ManishPatil in forum Symbian C++
    Replies: 0
    Last Post: 2004-12-09, 11:55
  5. Memory Leaks
    By abhishekmishra in forum Symbian C++
    Replies: 1
    Last Post: 2002-08-21, 15:44

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved