[MPlayer-users] [Patch] Disable file syatem driver cache
zongyao.qu at gmail.com
Fri Dec 16 03:38:11 CET 2011
Sorry I don't know how to post a attachment,
so I copy-paste the content in the post.
Fri Dec 16 11:18:15 2011
Fri Dec 16 11:15:40 2011
@@ -175,6 +175,10 @@
+ // turn os file caching off
+ fcntl( f, F_NOCACHE, 1 );
+ // enable read ahead
+ fcntl( f, F_RDAHEAD, 1 );
[ This patch is especially useful for Mac OSX, but I am
not sure how about Linux and other OSs. ]
In Mac, the driver will fill the unused memory
for caching, by default.
So if a huge file(1080P, etc) is played, driver will
use up all the memory, and if there are other apps ask
for memory, page swap will happen.
This is not a leak, but it seams driver won't release
that cache, until I reboot it, or unmount the
volume in which the cached media file is.
So I think disabling the driver caching for Mac seams to
be a good idea, BUT accordingly, the soft cache must be
always ON, otherwise, it will be lagging.
So if this patch is accepted, I think the side effect
should also be written somewhere.
More information about the MPlayer-users