[issue15635] memory leak with generators

2012-08-17 Thread Florent Xicluna
Florent Xicluna added the comment: Thank you for digging into this. I close the issue. I discover now that this kind of problem is quite common in the Mac world. Other references: http://news.ycombinator.com/item?id=3879194 http://www.markvanda.net/apple/mac-os-x-memory-issues/ -- reso

[issue15635] memory leak with generators

2012-08-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: > > All of this clearly points towards malloc not releasing allocated memory to > > the system. > > This is perfectly fine and not a bug in either Python or the system. > > So it means there's no reliable way to measure the memory consumption of the > program.

[issue15635] memory leak with generators

2012-08-13 Thread Florent Xicluna
Florent Xicluna added the comment: > All of this clearly points towards malloc not releasing allocated memory to > the system. > This is perfectly fine and not a bug in either Python or the system. So it means there's no reliable way to measure the memory consumption of the program. Sorry for

[issue15635] memory leak with generators

2012-08-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: > The test case finds some leak in 3.3 too, it seems. 3.3 should be much better since it uses mmap() and munmap() to manage the object allocator's arenas (unless this is disabled under OS X for some reason, that is). Here under Linux: $ python3.3 testiterbug

[issue15635] memory leak with generators

2012-08-13 Thread Ronald Oussoren
Ronald Oussoren added the comment: I've added calls to vmmap to the script (using os.system) to check my guesss. The relevant bit after the call to test_iter(1<<24): REGION TYPE VIRTUAL === === MALLOC405.9M

[issue15635] memory leak with generators

2012-08-13 Thread R. David Murray
Changes by R. David Murray : -- nosy: +r.david.murray ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://ma

[issue15635] memory leak with generators

2012-08-13 Thread Ronald Oussoren
Ronald Oussoren added the comment: BTW. I don't think this is a memory leak, the amount of memory used doesn't increase when there are more calls to test_iter(1<<23). -- ___ Python tracker

[issue15635] memory leak with generators

2012-08-13 Thread Ronald Oussoren
Ronald Oussoren added the comment: I can reproduce this on an OSX 10.8 system, both using python 2.7 and python 3.3. The growth is significantly less using python 3.3. What's odd is that the growth does not occur when both test_iter calls use 1<<24 as the argument (or larger values). If I'd h

[issue15635] memory leak with generators

2012-08-13 Thread Florent Xicluna
Florent Xicluna added the comment: Though, I cannot reproduce on Debian Squeeze (2.6.6 deb or 2.7 from source) or Ubuntu (2.7.2+ or 3.2). Someone on OS X might confirm the same issue. This is python 2.7.3 installed from source (using perlbrew) and GCC 4.2.1. The output of the script is: $ py

[issue15635] memory leak with generators

2012-08-13 Thread Florent Xicluna
Florent Xicluna added the comment: I don't mean perlbrew, but homebrew (an OS X package manager to install from source). -- ___ Python tracker ___ __

[issue15635] memory leak with generators

2012-08-13 Thread Florent Xicluna
New submission from Florent Xicluna: Hello, I noticed a large memory consumption in my application. I tracked it down to be a problem with garbage collection of generator locals. The issue was noticed in 2.6 first. Then I reproduced it in 2.7. The test case finds some leak in 3.3 too, it seems.