堆很容易使用。在代码中的某些时候,你必须编写以下代码:
from guppy import hpyh = hpy()print h.heap()
这将为你提供如下输出:
Partition of a set of 132527 objects. Total size = 8301532 bytes.Index Count % Size % Cumulative % Kind (class / dict of class)0 35144 27 2140412 26 2140412 26 str1 38397 29 1309020 16 3449432 42 tuple2 530 0 739856 9 4189288 50 dict (no owner)
你还可以从哪里找到对象的引用,并获取有关该对象的统计信息,但是以某种方式,该文档上的文档很少。
还有一个用Tk编写的图形浏览器。



