s7v7nislands schrieb:
hi all:

test.py
#!/usr/bin/python
a = []
for i in xrange(1000000):
    a.append('a'*500)


$python -i test.py     #virt mem 514m in top output
del a                   #virt mem 510m

why python cache these string?
In source, I see when object size > SMALL_REQUEST_THRESHOLD, python
would use malloc.
also use free() when string refcount == 0.

do I miss somethong?

http://effbot.org/pyfaq/why-doesnt-python-release-the-memory-when-i-delete-a-large-object.htm

Diez
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to