• 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: NSMutableArray + NSEnumerator = No Memory
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSMutableArray + NSEnumerator = No Memory


  • Subject: Re: NSMutableArray + NSEnumerator = No Memory
  • From: "Igor Mozolevsky" <email@hidden>
  • Date: Sat, 22 Sep 2007 20:40:31 +0100

On 22/09/2007, James Bucanek <email@hidden> wrote:

> I never noticed this before, because the collection were
> reasonably small (5-100 items), but this user had 30,000 items.
> The enumerator is used to search for a match (the match is
> complicated, so isEquals/containsObject is not an option). This
> will happen (you guessed it!) 30,000 times -- my application is
> trying to allocate 900,000,000 temporary object pointers (30,000
> x 30,000) and naturally runs out of memory.


900,000,000 * 4 = 3,600,000,000 BYTES!!! MacOS X per application
memory limit = 4GB (last time I checked), that's with all the UI
candy, ObjC baggage, etc!  Can you not process them a small bunch at a
time?

--
Igor M.
_______________________________________________

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: NSMutableArray + NSEnumerator = No Memory
      • From: "Igor Mozolevsky" <email@hidden>
References: 
 >NSMutableArray + NSEnumerator = No Memory (From: James Bucanek <email@hidden>)

  • Prev by Date: Re: NSMutableArray + NSEnumerator = No Memory
  • Next by Date: Re: NSMutableArray + NSEnumerator = No Memory
  • Previous by thread: Re: NSMutableArray + NSEnumerator = No Memory
  • Next by thread: Re: NSMutableArray + NSEnumerator = No Memory
  • Index(es):
    • Date
    • Thread