I have a python class foo
that contains:
- data (ints, floats)
- lists (of ints, of floats, and of other objects)
- dictionaries (of ints, of floats, of other objects)
Assuming that there are no back-references (cycles), is there an easy way to measure the total memory usage of a foo
object ?
Essentially, I am looking for a recursive version of sys.getsizeof
A few of the tools I came across included: heapy, objgraph and gc, but I don't think any of them are up to the task (I may be corrected on this)