Re: Is this normal (memory allocation)
Re: Is this normal (memory allocation)
- Subject: Re: Is this normal (memory allocation)
- From: j o a r <email@hidden>
- Date: Thu, 28 Oct 2004 22:32:31 +0200
This topic has been on the list several times. If I guess correctly,
your problem is that you accumulate a lot of autoreleased objects that
will not be released until you have completed your iteration. This is
not a memory leak, but can be a problem nonetheless. The solution is
simple; implement a local autorelease pool that you empty every so
often. More info on this strategy can be found on the web and in the
list archives.
j o a r
On 2004-10-28, at 22.12, Jesus De Meyer wrote:
In my app I go through a folder recursively and get the icons of each
file which I then put on a menuitem. So basically I just put the
folder/item hierachy in a menu structure.
I've found that depending how deep I go through the root folder, the
app consumes a lot of memory if I go through a deep hierarchy (over
100 MB). However, when I select a rootfolder that's less deep, the
memory consumption is less (around 30 to 40 MB)
To get the icons of the file, I use NSWorkspace iconForFile method,
resize the image to 16x16 and put it on an NSMenuItem.
Now, is this behaviour normal, or am I having a nasty memory leak
somewhere?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden