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???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()
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).