我有一个Python客户端 - 服务器应用程序,它的服务器已经运行了大约4天......它的内存使用情况(如/ proc/PID/status-> VmSize所报告的)已增长到约660Mb,我想知道如果有可能是内存泄漏,所以我用objgraph打印出它的内存使用情况(第20对象类型):解释objgraph数字:内存泄漏?
58524 tuple
33270 dict
15483 function
9976 list
5396 set
2644 weakref
2489 builtin_function_or_method
2482 instancemethod
1898 OrderedSet
1751 _BindParamClause
1680 _generated_label
1485 Comparator
1398 type
1315 InstrumentedAttribute
1267 CustomColumn
1165 cell
1146 ScalarAttributeImpl
1146 ColumnProperty
1146 ColumnLoader
1075 wrapper_descriptor
我看不出有什么特别的“臭”还有,我失去了什么?也许这只是因为Python doesn't立即释放未使用的内存到操作系统?
(这是一个CherryPy + SQLAlchemy应用程序)
经过几天的观察,你是否注意到,每天都有哪些特定的对象类别在内存使用中逐渐增加?还是全部是? :) – 2011-05-17 12:14:52
那么你发现了什么? – 2012-08-18 17:13:36