I will write a memorandum on how to check the memory size of a variable in Python.
Returns the size of the argument in bytes.
>>> import sys
>>> x1 = [1, 2, 3, 4, 5]
>>> sys.getsizeof(x1)
104
>>> x2 = ['a', 'b', 'c']
>>> sys.getsizeof(x2)
88
-29.1.sys — System Parameters and Functions Python 3.6.1 Documentation
Recommended Posts