• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Calling allObjects memory allocation problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calling allObjects memory allocation problem


  • Subject: Re: Calling allObjects memory allocation problem
  • From: Keary Suska <email@hidden>
  • Date: Fri, 21 May 2010 08:48:59 -0600

On May 20, 2010, at 9:37 PM, Nick Zitzmann wrote:

> On May 19, 2010, at 5:36 AM, Vassilis Pantazis wrote:
>
>> Hello,
>>
>> I have in my code the following statement:
>>
>>   NSDirectoryEnumerator* dirEnum;
>>   NSArray* inDirContents;
>>
>>   dirEnum = [[NSFileManager defaultManager] enumeratorAtPath:inPath]; //
>> inPath is a valid path
>>   inDirContents = [dirEnum allObjects];
>>
>> I have noticed that when the path contains many objects, a significant
>> amount of memory is allocated that is not released, neither when trying to
>> explicitly release inDirContents, nor when using an autorelease pool.
>> Can someone explain to me why this happens please and how to solve it?

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. This is a key reason for recommendations on keeping a low peak memory footprint. Search the archives for more discussions on these issues.

HTH,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Calling allObjects memory allocation problem
      • From: "Paul Sanders" <email@hidden>
References: 
 >Calling allObjects memory allocation problem (From: Vassilis Pantazis <email@hidden>)
 >Re: Calling allObjects memory allocation problem (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: Re: NSPrintInfo printSettings archiving
  • Next by Date: Re: iPhone/iPad: Desktop wallpaper can't be set.
  • Previous by thread: Re: Calling allObjects memory allocation problem
  • Next by thread: Re: Calling allObjects memory allocation problem
  • Index(es):
    • Date
    • Thread