Diagramming Python Object Graphs
If you ever want to look at the dependency graph of a python object:
import objgraph
obj = objgraph.by_type('OAG_AutoNode1a')[0]
objgraph.show_backrefs([obj], filename='depgraph.png', max_depth=100)
This will dump the dependency graph for the first OAG_AutoNode1a object into a file depgraph.png
.
Useful for finding memory leaks. Requires the objgraph
python module and the graphviz
(system) package:
pip-3.6 install objgraph --user
pkg install graphviz