How would you go about finding out how much memory is being used by an object? I know it is possible to find out how much is used by a block of code, but not by an instantiated object (anytime during its life), which is what I want.
Try this:
sys.getsizeof(object)
getsizeof() calls the object’s __sizeof__
method and adds an additional garbage collector overhead if the object is managed by the garbage collector.