[python] Find out how much memory is being used by an object in Python

Another approach is to use pickle. See this answer to a duplicate of this question.