Re: NSMutableArray + NSEnumerator = No Memory
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