views:

85

answers:

1

How can i trace memory consumed by an object in its life time when i am testing my application on device? [e.g.: without any instruments if possible]

+1  A: 

One way to accomplish this is to use NSKeyArchiver. You can serialize your object out and then determine it's size. This will would limit the type of data your object can hold. You can check out the docs here:

http://developer.apple.com/mac/library/documentation/cocoa/Conceptual/Archiving/Archiving.html#//apple_ref/doc/uid/10000047i

logancautrell
The archived form of an object may be larger or smaller than the unarchived form. It is at best, an estimate.
rpetrich
Agreed, using instruments is the best way to track objects life cycles.
logancautrell