mdickinson / refcycle

Support for displaying and analyzing reference graphs of Python objects.
Apache License 2.0
15 stars 1 forks source link

Add reference counts to ObjectGraph #58

Open mdickinson opened 7 years ago

mdickinson commented 7 years ago

When detecting errors caused by reference counting bugs (e.g., in 3rd party extension modules), it's useful to be able to compare the reference count of an object in a snapshot with the expected reference count based on the number of edges into that object: a mismatch may be evidence of a reference counting bug.

For this, it would be useful to be able to annotate the objects in an ObjectGraph with the result of calling sys.getrefcount on that object, suitably modified for local references.