Re: massive amounts of offscreen windows
Re: massive amounts of offscreen windows
- Subject: Re: massive amounts of offscreen windows
- From: Yann Bizeul <email@hidden>
- Date: Fri, 22 Aug 2003 16:57:46 +0200
Hi,
It looks like a problem I had with GeekTool. There is a point I
understand in your description is that you do not require user actions
to make things, that was the same problem for me, and it seem that if
you do not have user actions, autorelease pools are not always
correctly de-allocated.
The solution for me was to set an autorelease pool in some critical
methods like this :
NSAutoreleasePool *pool = [[ NSAutoreleasePool alloc ] init ];
[ do things ]
[ pool release ];
Let me know what you think/test/sucess :-)
--
Yann Bizeul
TYNSOE.ORG -
http://www.tynsoe.org/
Site technique consacri ` MacOS X
Projets :
http://projects.tynsoe.org/
On Friday 22 August 2003, at 05:31AM, Ev wrote:
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.
_______________________________________________
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.