needleinthehay.de

Get Memory Size of an Object

from sys import getsizeof

msg = "Hello my friends!"
size = getsizeof(msg)
print(size)