<[EMAIL PROTECTED]> wrote: >If I write: > >a = range(500*1024) > >I see that python process allocate approximately 80Mb of memory. >What can i do for DEALLOCATE this memory, or good part of this? > [ ... ] >I've tried with Destroy, del command, but the memory don't show down.
It won't (much). When an object gets garbage collected Python will keep hold of the memory and reuse it. Note how much memory your process is using after assigning a above, then: >>> del a Of course, you've seen this doesn't release back to the OS all the memory being that was being used. But now do: >>> a = range(500*1024) and you'll see that you're using no more memory than you were after the first assignment. If your memory usage keeps on growing then either (a) your program needs that much memory for the data, and you'll just have to stick more in your box or deal with swapping if this is causing you a problem or (b) you've got some stray references left over to objects you think you've deleted. -- \S -- [EMAIL PROTECTED] -- http://www.chaos.org.uk/~sion/ ___ | "Frankly I have no feelings towards penguins one way or the other" \X/ | -- Arthur C. Clarke her nu becomeþ se bera eadward ofdun hlæddre heafdes bæce bump bump bump
-- http://mail.python.org/mailman/listinfo/python-list