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

Arnaud Delobelle arnodel at googlemail.com
Sun Apr 20 06:03:07 EDT 2008


On Apr 20, 9:40 am, "Hank @ITGroup" <hank.info... at gmail.com> wrote:
> Hi, people!
>
> Greetings~
> 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 ???
> Cheers!!!

You mistyped your subject line; it should have read:

    "Help needed - I don't understand how Python manages memory"

--
Arnaud




More information about the Python-list mailing list