• 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: What is using up so much memory here?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What is using up so much memory here?


  • Subject: Re: What is using up so much memory here?
  • From: Dave Camp <email@hidden>
  • Date: Tue, 10 Mar 2009 16:37:34 -0700

On Mar 10, 2009, at 4:26 PM, James Cicenia wrote:

Here is the offending code that sucks up about 2MB:

NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
while(thisState = [statesEnum nextObject]){
UIImageView *singleStateView = [[[UIImageView alloc]initWithFrame:CGRectMake(2,0, 293, 184)]autorelease];
[singleStateView setImage: [UIImage imageNamed:[[@"wf-map-gray-" stringByAppendingString:thisState ]stringByAppendingString:@"_glow.png"]]];
[singleStateView setTag:100];
[fruitStateView addSubview:singleStateView];
}
[pool release];


These are little pngs of the states. They are tiny 4KB images
yet when this loop runs it winds up taking up an additional 2MB

Well, the PNG files are 4KB. The images are approximately 215KB when decompressed (293 * 184 * 4 bytes/pixel = 215,648). Probably slightly larger when the rows are padded out (assuming the PNG images are the size of the view you are creating in the code you supplied).


Dave
_______________________________________________

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


References: 
 >What is using up so much memory here? (From: James Cicenia <email@hidden>)

  • Prev by Date: Re: What is using up so much memory here?
  • Next by Date: Re: What is using up so much memory here?
  • Previous by thread: Re: What is using up so much memory here?
  • Next by thread: Odd interaction of NSTrackingArea behaviour with drag and drop
  • Index(es):
    • Date
    • Thread