fadvise - File ADVISE: give file advisory information
fadvise [options] file [...]
Options: -help - brief help message -man - full documentation -sequential -random -willneed -dontneed -noreuse -normal (default) -offset=n -length=n -verbose -noverbose
Under Linux 2.6.9, this is known to cause the file content to be evicted from the buffer-cache immediately.
Note that this option first causes an fsync of the file.
fadvise is a command used to give file advisory information to the operating system.
Its ``don't need'' option (fadvise --dontneed) is particularly useful to cause the files' pages (blocks) to be evicted from the buffer-cache.
$ fadvise --verbose --dontneed foo.rrd page size: 4096 foo.rrd: no incore pages.
-dontneed might be the only really useful option.
In verbose mode, you may get an error from mincore such as ``cannot allocate memory'' if the file size is zero.
Some operating systems have posix_fadvise, but it doesn't work. For instance under Linux 2.4, you may see this error:
posix_fadvise: Inappropriate ioctl for device
Dave Plonka <plonka@cs.wisc.edu>
Copyright (C) 2007 Dave Plonka. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This is fadvise $Revision: 1.5 $.
The fincore command.