Python 分析时缺少内存

Python 分析时缺少内存,python,memory,memory-leaks,profiling,Python,Memory,Memory Leaks,Profiling,我正在使用heapy内存分析器来计算python程序中发生的内存膨胀。正如您在下面的时间线中所看到的,时间线中t1和t2之间的内存量根据任务管理器报告的内容增长约20 MB,但根据heapy的报告,仅增长1.6 MB。剩下的记忆在哪里?这是否表示碎片化?如何验证哪个对象(例如CloudEntry)导致了碎片 时间线: t1 66 MB专用字节任务管理器 hpy().setrelheap() // program runs ... // ... // .. // . t2 86 MB专用字节任

我正在使用heapy内存分析器来计算python程序中发生的内存膨胀。正如您在下面的时间线中所看到的,时间线中t1和t2之间的内存量根据任务管理器报告的内容增长约20 MB,但根据heapy的报告,仅增长1.6 MB。剩下的记忆在哪里?这是否表示碎片化?如何验证哪个对象(例如CloudEntry)导致了碎片

时间线:

t1 66 MB专用字节任务管理器

hpy().setrelheap()
// program runs ... 
// ...
// ..
// .
t2 86 MB专用字节任务管理器:

Partition of a set of 21897 objects. Total size = 1868016 bytes.
 Index  Count   %     Size   % Cumulative  % Kind (class / dict of class)
     0    926   4   485224  26    485224  26 dict of common.cloud_entry.CloudEntry
     1   5564  25   431040  23    916264  49 str
     2   1888   9   219008  12   1135272  61 __builtin__.set
     3    388   2   203312  11   1338584  72 dict of Queue.Queue
     4   1164   5   162960   9   1501544  80 dict of threading._Condition
     5   2328  11    83808   4   1585352  85 types.BuiltinFunctionType
     6   4561  21    54732   3   1640084  88 int
     7   1172   5    44688   2   1684772  90 list
     8   1164   5    37248   2   1722020  92 threading._Condition
     9    926   4    29632   2   1751652  94 common.cloud_entry.CloudEntry
<64 more rows. Type e.g. '_.more' to view.>