Charles-Francois Natali <neolo...@free.fr> added the comment: > BTW, after utilize lxml instead of ElementTree, such phenomenon of increasing > memory usage disappeared.
If you looked at the link I posted, you'll see that lxml had some similar issues and solved it by calling malloc_trim systematically when freeing memory. It could also be heap fragmentation, though. To go further, it'd be nice if you could provide the output of valgrind --tool=memcheck --leak-check=full --suppressions=Misc/valgrind-python.supp python <test script> after uncommenting relevant lines in Misc/valgrind-python.supp (see http://svn.python.org/projects/python/trunk/Misc/README.valgrind ). It will either confirm a memory leak or malloc issue (I still favour the later). By the way, does while True: XML(gen_xml()) lead to a constant memory usage increase ? ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue11849> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com