[issue11849] glibc allocator doesn't release all free()ed memory

2011-04-25 Thread kaifeng
kaifeng cafe...@gmail.com added the comment: Sorry for the later update. Valgrind shows there is no memory leak (see attached valgrind.log). The following code, while True: XML(gen_xml()) has an increasing memory usage in the first 5~8 iterations, and waves around a constant level

[issue11849] ElementTree memory leak

2011-04-18 Thread kaifeng
kaifeng cafe...@gmail.com added the comment: Found a minor defect of Python 3.2 / 3.3: line 1676 of xml/etree/ElementTree.py was: del self.target, self._parser # get rid of circular references should be: del self.target, self._target, self.parser, self._parser # get rid of circular

[issue11849] ElementTree memory leak

2011-04-18 Thread kaifeng
kaifeng cafe...@gmail.com added the comment: I applied your patch to Python 3.2, also I added a function call to 'malloc_trim' via ctypes, as you can see in issue11849_test2.py. In fact I have a daemon written in Python 2.5, parsing an XML of size 10+ MB every 5 minutes, after 16+ hours

[issue11849] ElementTree memory leak

2011-04-17 Thread kaifeng
kaifeng cafe...@gmail.com added the comment: I added 'malloc_trim' to the test code and rerun the test with Python 2.5 / 3.2 on CentOS 5.3. The problem still exists. *** Python 2.5.5 final --- PID TTY STAT TIME MAJFL TRS DRS RSS %MEM COMMAND 0 2567 pts/0S+ 0:00

[issue11849] ElementTree memory leak

2011-04-15 Thread Kaifeng Zhu
New submission from Kaifeng Zhu cafe...@gmail.com: I'm using xml.etree.ElementTree to parse large XML file, while the memory keep increasing consistently. You can run attached test script to reproduce it. From 'top' in Linux or 'Task Manager' in Windows, the memory usage of python

[issue11849] ElementTree memory leak

2011-04-15 Thread Kaifeng Zhu
Kaifeng Zhu cafe...@gmail.com added the comment: Yes. Just tested with Python 2.7 and 3.2 in Windows 7, the memory usage is still unexpected high after 'Done' is printed. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11849

[issue11849] ElementTree memory leak

2011-04-15 Thread kaifeng
kaifeng cafe...@gmail.com added the comment: Python 3.2 On Linux (CentOS 5.3) *** Python 3.2.0 final --- PID TTY STAT TIME MAJFL TRS DRS RSS %MEM COMMAND 0 15116 pts/0S+ 0:00 1 1316 11055 6452 0.6 python3.2 issue11849_test.py 1 15116 pts/0S+ 0:02