fincore - File IN CORE: show which blocks of a file are in core
fincore [options] <-stdin | file [...]>
Options: -help - brief help message -man - full documentation -summary - report summary statistics for the files -justsummarize - just report summary statistics for the files -stdin - read file names from standard input
fincore is a command that shows which pages (blocks) of a file are in core memory.
It is particularly useful for determining the contents of the buffer-cache. The name means ``File IN CORE'' and I pronounce it ``eff in core''.
$ fincore foo.rrd foo.rrd: no incore pages.
$ cat foo.rrd >/dev/null # read the whole file $ fincore foo.rrd foo.rrd: 26 incore pages: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
$ ls |grep '\.rrd$' |~/perl/fincore --stdin --justsummarize page size: 4096 bytes 2214049 pages, 8.4 Gbytes in core for 268994 files; 8.23 pages, 32.9 kbytes per file.
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 fincore $Revision: 1.9 $.
The fadvise command.