I am tracking the Performance of an application and just wanna clarify a few points.
1. Does cached images ([UIImage imageNamed:@"abc.jpg"]) affect Resident/ Dirty Size ?
2. In some views created from NIB, I found the retainCount of _tableView to be 2 (at viewDidLoad)... How it became 2 (actually it must be 1, right!!!)
3. Does releasing all objects at viewDidUnload/ dealloc do the magic of reducing the Resident Size of the app ?
I am tracking the Performance of an application and just wanna clarify a few points.
1. Does cached images ([UIImage imageNamed:@"abc.jpg"]) affect Resident/ Dirty Size ?
2. In some views created from NIB, I found the retainCount of _tableView to be 2 (at viewDidLoad)... How it became 2 (actually it must be 1, right!!!)
3. Does releasing all objects at viewDidUnload/ dealloc do the magic of reducing the Resident Size of the app ?
Hit you later with a few more questions.
1. If you wonder if the image is loaded in the RAM in raw format, i do believe so.
2. If you have a reference to the view, like an IBOutlet, you will have one retain for that, and one more when the view is added as a subview.
3. Should do exactly that.
1. If you wonder if the image is loaded in the RAM in raw format, i do believe so.
2. If you have a reference to the view, like an IBOutlet, you will have one retain for that, and one more when the view is added as a subview.
3. Should do exactly that.
Thanks First.
1. Could you detail me on that? I get the image content from server's response _data(an NSData). I create an image with imageWithData. Does that load the RAM as you said?
2. Yep, I can find _tableView as an IBOutlet. I forgot that it increases 1 on adding as Subview. Thanks.
3. Clean.
1. Could you detail me on that? I get the image content from server's response _data(an NSData). I create an image with imageWithData. Does that load the RAM as you said?
Well, when you get it as an NSData, it is already in RAM, and when you create a UIImage with that data it will stay get copied once more in RAM until you remove it or it will be purged due to low memory. You should be able to release the NSData right after you initiate the image.
I haven't done any testing on this but it should be quite easy to run with the profiler to see exactly how much memory gets allocated where.