擅长:python、mysql、java
<p>不幸的是,您可能无法释放所有内存:</p>
<p><a href="http://effbot.org/pyfaq/why-doesnt-python-release-the-memory-when-i-delete-a-large-object.htm" rel="nofollow noreferrer">http://effbot.org/pyfaq/why-doesnt-python-release-the-memory-when-i-delete-a-large-object.htm</a></p>
<p>还有,试试看gc.收集(),见第二个答案:</p>
<p><a href="https://stackoverflow.com/questions/1316767/how-can-i-explicitly-free-memory-in-python">How can I explicitly free memory in Python?</a></p>