• 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: Fixing my massive memory leak with NSImage/CALayer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fixing my massive memory leak with NSImage/CALayer


  • Subject: Re: Fixing my massive memory leak with NSImage/CALayer
  • From: Nathan Vander Wilt <email@hidden>
  • Date: Tue, 1 Apr 2008 19:47:44 -0700

On Apr 1, 2008, at 4:24 PM, Jens Alfke wrote:
On 1 Apr '08, at 11:07 AM, Nathan Vander Wilt wrote:

The NSImage that my FRPhoto holds on to should have "invalidate[d] and free[d] the offscreen caches of all image representations".

That doesn't mean the image representations themselves are flushed, though. They're still there, typically holding onto big uncompressed pixmaps. All -recache does is flush extra copies of those pixmaps that were copied into VRAM to speed up blitting.


If you want the pixmaps out of memory, you have to dealloc the NSImages themselves.

Okay, I was confusing "representations" with "caches" -- using lazy initialization for the representations is equivalent to allocating the representations eventually. A more careful reading of http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaDrawingGuide/Images/chapter_7_section_2.html explains "-recache" in the correct context. Looks like I'll have to design a smarter architecture to keep the right images in memory at the right time.


It was really frustrating to see my app balloon up like that without understanding what was going on. Thanks much for your help!

-natevw

_______________________________________________

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: Fixing my massive memory leak with NSImage/CALayer
      • From: Jens Alfke <email@hidden>
References: 
 >Fixing my massive memory leak with NSImage/CALayer (From: Nathan Vander Wilt <email@hidden>)
 >Re: Fixing my massive memory leak with NSImage/CALayer (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: Finding out about new windows.
  • Next by Date: activate my application while dragging on other application window
  • Previous by thread: Re: Fixing my massive memory leak with NSImage/CALayer
  • Next by thread: Re: Fixing my massive memory leak with NSImage/CALayer
  • Index(es):
    • Date
    • Thread