I've been using memcached for cache storage in my web application that's used by several of our customers. But, it only has a maximum size of 1 MB so I'm looking for a function that would measure the actual size of selected objects/arrays/etc. so I can prevent them from growing so big. This will only be used as a diagnostic tool so I can keep track of the cache performance / storage possibilities. Would anyone know of a way to measure PHP objects actual size in bytes?