Added function to get memory used by the cache