How much memory is reserved when initializing NSObject?

objective-c

Solution

You can test the size of objects with the following code:

#import <malloc/malloc.h>
//...
NSObject *obj = [[NSObject alloc] init];
NSLog(@"Size: %zd bytes", malloc_size((__bridge const void *)(obj)));

This test produced: "Size: 16 bytes"

Problem

When I use this statement in objective c ``` NSObject object = [[NSObject alloc] init]; ``` How much memory is reserved for object?

Original source