memcache internally and invariably uses pickle and saves the resulting string, so you can check it with len(pickle.dumps(yourobject, -1)) . Note that sys.getsizeof (which requires 2.6 or better, which is why it is missing from GAE) doesn't really help you at all:
>>> import sys >>> sys.getsizeof(23) 12 >>> import pickle >>> len(pickle.dumps(23, -1)) 5
since the size of the serialized brine of the object can be very different from the size of the object in memory, as you can see (therefore, I think you should feel grateful to GAE for not offering sizeof, which would lead you astray -.)
source share