Thread Memory Leak
Skip Montanaro
skip at pobox.com
Tue Jun 25 10:12:42 EDT 2002
>> You never remove any thread objects from your listThread list. It
>> fills up with completed threads.
Peter> Actually, the list is rebound to a new empty list each pass
Peter> through the while loop...
Duh... That's what I get for answering questions so early in the morning...
I do see some strange behavior, now that I actually run the code. Running
it as
python threadgrowth.py | egrep -v RSS | uniq
yields output like
3288 1984
3292 1992
3296 1996
13536 2016
3296 1996
15584 2020
3296 1996
21728 2044
19680 2028
15584 2020
3296 1996
19680 2028
3296 1996
17632 2032
3296 1996
I don't know why it bounces around like that, but the minimum VSZ does go
up:
3296 1996
19680 2032
7392 2008
3296 1996
20704 2032
4320 2000
16608 2028
20704 2040
20704 2036
4320 2000
20704 2036
4320 2000
16608 2024
4320 2000
14560 2020
4320 2000
20704 2032
4320 2000
16608 2024
18656 2032
4320 2000
18656 2028
4320 2000
This was after just a couple minutes of running.
Skip
More information about the Python-list
mailing list