• 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
massive amounts of offscreen windows
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

massive amounts of offscreen windows


  • Subject: massive amounts of offscreen windows
  • From: Ev <email@hidden>
  • Date: Thu, 21 Aug 2003 22:31:49 -0500

Hey everybody

I seem to be having a memory leak or issue with offscreen windows - my app does a lot of drawing, but it does it all actively. There's no need for me to be caching things. When my visuals scroll, I redraw them instead of drawing the whole thing and letting a scroll bar do it's 'natural' thing - the graphics would be too large if I did that - there's not much possibility of it drawing the same display again. I make the drawing code super small and efficient - and it seems OK for awhile...

But as a result, it seems that the more I use the app, it becomes slower and slower, with disk access becoming more and more common. My suspicions were confirmed when I looked at [[NSApp windows] count] before I closed my app - I had 150 offscreen windows!! I would assume sometimes there were even more...

My images are set up like this:

waveformImage = [[NSImage allocWithZone:[self zone]] initWithSize:WaveformSize];
[waveformImage addRepresentation:[[[NSCustomImageRep alloc] initWithDrawSelector:@selector(drawWaveform:) delegate:self] autorelease]];
[waveformImage setCacheMode:NSImageCacheNever];

Not much surprise there, but it seems as though it *is* caching - or is it? How can there be so many offscreen windows when they're supposed to be freed everytime I call [waveformImage recache]? Is it saving every small scrolling image I draw as an offscreen window, and never getting rid of it?

Anybody have any insight?
-ev
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: massive amounts of offscreen windows
      • From: Yann Bizeul <email@hidden>
  • Prev by Date: Re: Autorelease problem with NSKeyedUnarchive
  • Next by Date: adding to login items & VISE
  • Previous by thread: Re: NSTableView scrollbars
  • Next by thread: Re: massive amounts of offscreen windows
  • Index(es):
    • Date
    • Thread