Networkx图形的内存使用情况? [英] Networkx graph memory usage?

查看:286
本文介绍了Networkx图形的内存使用情况?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何检查networkx图使用的内存量?

How to check the amount of memory used by networkx graph ?

有一种方法可以检查节点和边的数量,但是我找不到用于内存使用的方法?

There is method to check the number of nodes and edges, but I could not find one for memory usage ?

推荐答案

您可以通过将边缘列表的大小和节点列表的大小相加来获得估计值:

You can get an estimate by adding up the size of the edge list and the size of the node list:

 sys.getsizeof(G.edge) + sys.getsizeof(G.node)

这篇关于Networkx图形的内存使用情况?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆