This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author lopgok
Recipients lopgok
Date 2011-04-08.03:37:22
SpamBayes Score 8.9280805e-12
Marked as misclassified No
Message-id <1302233844.4.0.517722747064.issue11802@psf.upfronthosting.co.za>
In-reply-to
Content
I have a program which calls filecmp.cmp a lot.
It runs out of memory.
I read the source to filecmp, and then I periodically set
filecmp._cache = {}

Without doing this, filecmp's cache uses up all the memory in the computer.

There needs to be a documented interface to clear the cache.

I suggest a function
def clear_cache:
    _cache = {}

Without a documented interface, there is no standard way to clear the
cache. It is possible different versions of python will require
different methods to clear the cache, which will reduce python code
portability and is a bad idea.

Alternatively, one might disable the caching code.

One shouldn't have to look at the source code of a library function
to see why it is consuming memory.
History
Date User Action Args
2011-04-08 03:37:24lopgoksetrecipients: + lopgok
2011-04-08 03:37:24lopgoksetmessageid: <1302233844.4.0.517722747064.issue11802@psf.upfronthosting.co.za>
2011-04-08 03:37:23lopgoklinkissue11802 messages
2011-04-08 03:37:22lopgokcreate