On May 21, 2010, at 9:18 AM, Paul Sanders wrote: > > Also be aware that just because memory is released, doesn't mean it is > > returned to the system (e.g. you will not > > see your apps memory usage go down in Activity Monitor). In fact, AFAIK, > > it is never returned to the system, > > except perhaps in low memory situations. > > I don't actually think that's true. At least, it's not what I observe. I > think it's more accurate to say that you cannot predict when memory which has > been allocated and then freed will be returned to the operating system, nor > how much. It happens, I believe, in 4k pages, but probably not one at a time > and will be heavily dependent on fragmentation of the process's heap. No > doubt there is much more to know. > > I agree with the sentiment of keeping an eye on your peak memory usage. I > use Instruments for this, and it found one instance where memory usage was > creeping steadily up when the app was playing audio but otherwise idle.
Maybe AFAIK should be "As Far As I have Observed", as although using tools like instruments I have seen constant tiny increases and decreases, I have yet to see peak memory reduce over the lifetime of an application. Fragmentation could certainly play a role--I don't know of any means to check that. If this truly is the issue most of the time, it seems to me that for most practical points and purposes that the memory won't get returned anyway, as fragmentation seems to be so common. My main point though, is that if the OP thinks that his array is not getting released because he doesn't see memory usage decrease, then he is barking up the wrong tree. Keary Suska Esoteritech, Inc. "Demystifying technology for your home or business" _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com