???Python Memory Management S***s???

Hank @ITGroup hank.infotec at gmail.com
Sun Apr 20 10:40:26 CEST 2008

Hi, people!

These days I have been running a text processing program, written by 
python, of cause.
In order to evaluate the memory operation, I used the codes below:

 > string1 = ['abcde']*999999    # this took up an obvious memory space...
 > del string1                              # this freed the memory 
successfully !!

For primary variants, the *del* thing works well. However, challenge the 
following codes, using class-instances...

 > from nltk import FreqDist     # nltk stands for Natural Language Tool 
Kit (this is not an advertisement ~_~)
 > instance = FreqDist()
 > instanceList = [instance]*99999
 > del instanceList             # You can try: nothing is freed by this
??? How do you people control python to free the memory in python 2.5 or 
python 2.4 ???

More information about the Python-list mailing list