I have a custom proxy server that was using a WatchedFileHandler for logging requests (the files were rotated with logrotate). It was leaking memory, and I had to use supervisord's memmon plugin to restart it whenever it exceed a certain threshold. I eventually tried disabling the WatchedFileHandler, and memory usage flattened out. I also have a StreamHandler logging the requests, so I have to conclude the leak is in WatchedFileHandler or FileHandler. This is with Python 2.6.6.
Thanks for the report, but more information from the failing system may be needed to find the problem. Although 2.6 does not contain full unit test coverage, the default branch does - and I tested there with resource leak checking turned on, with no leaks being detected. An eyeball inspection fails to show where a leak could be occurring: WatchedFileHandler just makes stat() calls and, if appropriate, calls flush/close on the existing stream and open on the new one. Test output: vinay@eta-jaunty:~/projects/python/default$ ./python Lib/test/regrtest.py -R :: test_logging [1/1] test_logging beginning 9 repetitions 123456789 ......... 1 test OK.
Marked as pending since no further information is available. I will close this issue in two weeks unless more information becomes available; even after this, if you get more information, you can re-open this issue. Also please note that Python 2.6 is closed for changes other than security-related ones.
Sorry about this. Turns out the flattening of memory usage was a temporary coincidence, and I eventually tracked the bug down to an old version of MySQLdb.
History
Date
User
Action
Args
2022-04-11 14:57:18
admin
set
github: 56570
2011-06-29 01:31:35
japerk
set
status: pending -> closedresolution: not a bugmessages: +