Apology for the previous offensive title~~
:)
Thanks, Rintsch, Arnaud and Daniel, for replying so soon.
I redid the experiment. What following is the record -
``starting python`` # == Windows Task Manager:
Python.exe *4,076 *K memory-usage ==
.... fd3 = FreqDist()
.... for i in range(999999):f d3.inc(i)
.... fd4 = FreqDist()
.... for i in range(999999):f d4.inc(i)
.... del fd4
# == 28,788 K ==
That is my question, after ``del``, sometimes the memory space returns
back as nothing happened, sometimes not... ...
What exactly was happening???
Best regards to all PYTHON people ~~
!!! Python Team are great !!!
:)
Thanks, Rintsch, Arnaud and Daniel, for replying so soon.
I redid the experiment. What following is the record -
``starting python`` # == Windows Task Manager:
Python.exe *4,076 *K memory-usage ==
>>st1='abcdefg' *999999 # == 10,952 K ==
>>del st1 # == *4,104*K ==
>>st1='abcdefg' *999999 # == 10,952 K ==
>>del st1 # == 4,104 K ==
>>del st1 # == *4,104*K ==
>>st1='abcdefg' *999999 # == 10,952 K ==
>>del st1 # == 4,104 K ==
>>li = ['abcde']*999999 # == 8,024 K ==
>>del li # == *4,108* K ==
>>del li # == *4,108* K ==
>>from nltk import FreqDist # == 17,596 ==
>>fd = FreqDist() # == 17,596 ==
>>for i in range(999999):f d.inc(i) # == 53,412 ==
>>del fd # == *28,780* ==
>>fd2 = FreqDist() # == 28,780 ==
>>for i in range(999999):f d2.inc(i) # == 53,412 ==
>>del fd2 # == 28,780 K ==
>>fd = FreqDist() # == 17,596 ==
>>for i in range(999999):f d.inc(i) # == 53,412 ==
>>del fd # == *28,780* ==
>>fd2 = FreqDist() # == 28,780 ==
>>for i in range(999999):f d2.inc(i) # == 53,412 ==
>>del fd2 # == 28,780 K ==
>>def foo():
.... for i in range(999999):f d3.inc(i)
>> foo() # == *28,788* K ==
>>def bar():
.... for i in range(999999):f d4.inc(i)
.... del fd4
# == 28,788 K ==
>>bar() # == 28,788 K ==
That is my question, after ``del``, sometimes the memory space returns
back as nothing happened, sometimes not... ...
What exactly was happening???
Best regards to all PYTHON people ~~
!!! Python Team are great !!!
Comment