10.6.2 issues with F_NOCACHE?
10.6.2 issues with F_NOCACHE?
- Subject: 10.6.2 issues with F_NOCACHE?
- From: Marc Van Olmen <email@hidden>
- Date: Wed, 3 Feb 2010 23:53:05 -0500
hi,
Just trying to trace an issue with my app:
Our app runs fine under 10.5.8 (just retested this)
The app plays a playlist of HD videos and about 20Mbytes/second data rate. It plays a few of those clips in loop.
I'm using the standard unix open function to read from these files.
fFileRef = open(fFilePath,O_RDONLY);
if (fFileRef == -1) {
anError = kOS_Error_CouldntOpenFile;
goto bail;
}
BAIL_OSERROR(fcntl(fFileRef, F_NOCACHE, 1));
(Also QuickTime has these files open, but I don't use Quicktime to read) but maybe this is a cause.
There is only one file open at the time. Also my app doesn't allocate much memory once the video is playing. So the Application memory is constant for most of the time.
Under 10.6.2 I see something strange happening.Under Activity Memory: the System Memory->Free is decreasing after playing above clips for like 20 min.
Under System 10.5.8 this stays constant.
My system has 3GB of ram. Under 10.5.8 this stays around 1.5GB free available. Under 10.6.2 this goes to 200Mbytes after 20 min.
After a while I notice the "Swap used" starts to grow a little under 10.6.2 and this causes sometimes frame drops in my video playback app. Under 10.5.8 this doesn't happen.
When I go to the Terminal (10.6.2) and I use the 'purge' command Activity Memory: the System Memory->Free goes back 1.2 GBytes Free memory.
So this makes me assume that disk cache is being filled by my reading.
I also tested this on a system with 6GB and above symptoms happening also.
I also tried doing this:
BAIL_OSERROR(fcntl(fFileRef, F_RDAHEAD, 0));
no difference. Same behavior under 10.6.2
I tried:
BAIL_OSERROR(fcntl(fFileRef, F_GLOBAL_NOCACHE, 1));
no difference. Same behavior under 10.6.2
Not sure important: my memory pointer that i pass into the read, is an offset in a section of a big memory blob allocated with malloc.
* Any suggestion on how to get rid of this problem? I
* Did something changed under 10.6 regarding F_NOCACHE?
* Any suggestion on how trace this issue better? Is there a way I can trace when a read data is being added to the disk cache for example?
I didn't see anything in Instruments->Disk Activity. Maybe I missed something.
I can file a radar in case needed but just double checking if I'm overlooking something simple here.
cheers,
marc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden