How to know how much space is being occupied by a MemoryStore?

As MemoryStore has a very small memory size quota, I would like to know in advance how much space this is taking up, to avoid space overflow error (Code: 5).

How to know how much space is being occupied by a MemoryStore?