# coding:utf-8
from meliae import scanner
# path = '/srv/bpsg/bpsgcenter/tmp/dump.memory'
path = '../tmp/dump.memory'
path = '/Users/lamter/workspace/tmp/dump.memory'
# 导出内存状态
print scanner.dump_all_objects(path )
from meliae import loader
#加载dump文件
om = loader.load(path)
#计算各Objects的引用关系
om.compute_parents()
#去掉各对象Instance的_dict_属性
om.collapse_instance_dicts()
#分析内存占用情况
print om.summarize()
l = om.get_all('dict')
#查看第一个对象
print l[0]
#可以查看该对象的所有引用
print l[0].c[0]
#查看谁引用了这个对象
print l[0].p```