Re: memory management question
Re: memory management question
- Subject: Re: memory management question
- From: matt neuburg <email@hidden>
- Date: Sat, 20 Mar 2004 13:28:47 -0800
On 3/20/04 at roughly 9:56 AM, thus spake Michael Rothwell
<email@hidden>:
>
How about using something like this on the file descriptors?
>
>
fcntl(fd, F_NOCACHE, 1);
>
fcntl(fd, F_RDAHEAD, 1);
>
>
.... it seems to work for me, on Panther.
That is absolutely perfect. I can't thank you enough. You've no idea how
much experimenting and tweaking I've done over the past couple of months
with this app, trying to change its memory-management behavior from within
Cocoa itself. It seemed hopeless, and I worried that the app would just
never be viable. You've breathed new life into the whole project. My client
is going to be reeeeeally happy. m.
PS I take it that there is no downside to this that I need to watch out for?
I'm not, with these fcntl() calls, altering anything that I need to reset
afterwards, am I? Presently I am just creating the NSFileHandle from a
pathname, making the fcntl() calls, reading all the data, then sending
-closeFile to the NSFileHandle and then letting the NSFileHandle get
released in the usual way.
>
On Mar 20, 2004, at 11:05 AM, matt neuburg wrote:
>
> Once a TIFF has been read from disk, it will not be read
>
> again. The system is wrong to cache it; this is a false
>
> optimization. Thus, I am looking for a way to get the
>
> system to "give back" the RAM occupied by each TIFF
>
> after I am done with it. m.
--
matt neuburg, phd = email@hidden,
http://www.tidbits.com/matt/
pantes anthropoi tou eidenai oregontai phusei
AppleScript: the Definitive Guide! NOW SHIPPING...! (Finally.)
http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt
Subscribe to TidBITS! It's free and smart.
http://www.tidbits.com/
_______________________________________________
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.