In the GNU Objective-C runtime, you can use (you must import <objc/objc-api.h>
:
class_get_instance_size ([MyClass class]);
On Mac OS X you can use (you might need to import <objc/runtime.h>
):
class_getInstanceSize ([MyClass class]);
These functions will return how much memory is required to allocate an object, it will not include memory allocated by an object when it is initialised.