擅长:python、mysql、java
<p>我不知道你写什么意思:</p>
<blockquote>
<p>If not then what is wrong with code and how to correct it</p>
</blockquote>
<p>使用<code>del</code>语句时,删除对对象的引用。在调用所有垃圾收集器之前,它将耗尽内存。请记住,这可能是一个耗时的进程,如果该进程有足够的内存来继续执行,则不必这样做。</p>
一般来说,Python不执行C++类析构函数Baavivor。</p>
<p>引用“专家Python编程”:</p>
<blockquote>
<p>The approach of such a memory manager is roughly based on a simple
statement: If a given object is not referenced anymore, it is removed.
In other words, all local references in a function are removed after
the interpreter: </p>
<p>• Leaves the function</p>
<p>• Makes sure the object is not being used anymore.</p>
<p>Under normal conditions, the collector will do a
nice job. But a del call can be used to help the garbage collector by
manually removing the references to an object manually.</p>
</blockquote>
<p>所以你不能用手来管理记忆。你可以帮助垃圾收集器,但最好把内存管理留在幕后。</p>