Well, since Memcached doesn't store raw objects (it actually stores the serialiezd version), you can do this:
$serializedFoo = serialize($foo);
if (function_exists('mb_strlen')) {
$size = mb_strlen($serializedFoo, '8bit');
} else {
$size = strlen($serializedFoo);
}