Message133290
| 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:24 | lopgok | set | recipients:
+ lopgok |
| 2011年04月08日 03:37:24 | lopgok | set | messageid: <1302233844.4.0.517722747064.issue11802@psf.upfronthosting.co.za> |
| 2011年04月08日 03:37:23 | lopgok | link | issue11802 messages |
| 2011年04月08日 03:37:22 | lopgok | create |
|