[Tutor] Shelve doesn't free up memory
Timo
timomlists at gmail.com
Tue Mar 31 10:49:58 CEST 2009
Emile van Sebille schreef:
> Timo wrote:
>
> <snip>
>
>> # Results file
>> import shelve
>>
>> def read_result(person):
>> results = []
>>
>> s = shelve.open(RESULTFILE)
>> try:
>> results = s[person]
>
>
> Maybe passing this out prevents s from being garbage collected?
What do you mean by passing out?
I also tried gc.collect(), but no difference.
>
> Emile
>
>
>> except KeyError:
>> # print "No results for this person"
>> pass
>> finally:
>> s.close()
>>
>> return results
>> _______________________________________________
>> Tutor maillist - Tutor at python.org
>> http://mail.python.org/mailman/listinfo/tutor
>>
>
> _______________________________________________
> Tutor maillist - Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
More information about the Tutor
mailing list