计算上月并且返回格式为xx
socket.error: [Errno 32] Broken pipe错误的原因

objgraph无法生成分析图的原因

妙音 posted @ 2014年1月14日 13:23 in python , 8490 阅读

objgraph 是用于诊断内存问题的有用的工具 

安装objgraph

 

sudo pip install objgraph

用小段测试代码,生成png格式的分析图片

#encoding=utf-8
import objgraph


def main(hi):
    print hi

if __name__ == '__main__':
    hi = 'hi'
    main(hi)
    objgraph.show_backrefs([hi], filename='/tmp/hi.png')

会出现错误

Graph written to /tmp/objgraph-Nieb4E.dot (6 nodes)
Graph viewer (xdot) and image renderer (dot) not found, not doing anyt
hing else   

原因: 缺少依赖包

sudo yum install python-xdot  perl-Image-Dot

 

 

 

 

Avatar_small
N 说:
2014年5月25日 12:15

如果是在windows的情况下呢?

Avatar_small
N 说:
2014年5月25日 12:24

我安装了xdot,还是和你一样的错误

Avatar_small
妙音 说:
2014年5月31日 23:52

@N: 用objgraph生成的图不容易看懂,推荐python的meliae
http://yongqing.is-programmer.com/posts/43051.html

Avatar_small
custom paper bags 说:
2023年7月17日 14:46

Thank you because you have been willing to share information with us. we will always appreciate all you have done here because I know you are very concerned with our.

Avatar_small
shilajit uk 说:
2023年7月17日 16:09

Positive site, where did u come up with the information on this posting? I'm pleased I discovered it though, ill be checking back soon to find out what additional posts you include.

Avatar_small
Canvas Tarpaulins 说:
2023年7月17日 17:41

Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info.

Avatar_small
cosmetic boxes 说:
2023年7月17日 18:14

You make so many great points here that I read your article a couple of times. Your views are in accordance with my own for the most part. This is great content for your readers.

Avatar_small
safety gloves anti c 说:
2023年7月17日 18:33

Nice to read your article! I am looking forward to sharing your adventures and experiences.

Avatar_small
Canvas Tarpaulins 说:
2023年7月17日 18:43

Nice to read your article! I am looking forward to sharing your adventures and experiences.

Avatar_small
Madinah Airport to M 说:
2023年7月17日 19:42

Nice to read your article! I am looking forward to sharing your adventures and experiences.

Avatar_small
personalised paper b 说:
2023年7月24日 14:16

Useful information that is on it. just what i was looking for and i am looking forward to reading your other posts soon. You did a great job and thanks for sharing.

Avatar_small
Marketing Services 说:
2023年11月01日 23:18

This article was insightful and truly enlightening, a valuable source of knowledge.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter