|
NAME | SYNOPSIS | DESCRIPTION | OPTIONS | AUTHORS | SEE ALSO | REPORTING BUGS | AVAILABILITY |
|
|
|
FINCORE(1) User Commands FINCORE(1)
fincore - count pages of file contents in core
fincore [options] file...
fincore counts pages of file contents being resident in memory (in
core), and reports the numbers. If an error occurs during
counting, then an error message is printed to the stderr and
fincore continues processing the rest of files listed in a command
line. fincore uses the cachestat(2) syscall to count resident
pages. If the cachestat syscall is not available and cachestat
usage is not forced with the --cachestat option, then fincore uses
the mincore(2) syscall as a fallback. The cachestat syscall is
more efficient than mincore because it does not require a page
table lock to walks page tables, and also reports more information
than mincore, like the number of cached pages, dirty pages, pages
marked for writeback, evicted pages, and recently evicted pages.
Another difference between the two syscalls is that if write
permissions are not granted to the file, then cachestat returns an
error, while mincore for security reasons, returns fake data as if
all pages were resident in memory (c.f.r. kernel commit "make
mincore() more conservative"
<https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=134fca9063ad4851de767d1768180e5dede9a881>).
The default output is subject to change. So whenever possible, you
should avoid using default outputs in your scripts. Always
explicitly define expected columns by using --output columns-list
in environments where a stable output is required.
-n, --noheadings
Do not print a header line in status output.
-b, --bytes
Print sizes in bytes rather than in human-readable form.
By default, sizes are shown in units that are powers of 1024
bytes. The formal abbreviations for these units (KiB, MiB,
GiB, ...) are further shortened to just their first letter: K,
M, G, ....
-c, --total
produce a grand total.
-C, --cachestat
force usage of the cachestat() syscall instead of mincore(),
and fail if it’s not available.
-o, --output list
Define output columns. See the --help output to get a list of
the currently supported columns. The default list of columns
may be extended if list is specified in the format +list.
--output-all
Output all available columns.
-r, --raw
Produce output in raw format. All potentially unsafe
characters are hex-escaped (\x<code>).
-J, --json
Use JSON output format.
-R, --recursive
Recursively check all files in directories.
-h, --help
Display help text and exit.
-V, --version
Display version and exit.
Masatake YAMATO <yamato@redhat.com>
mincore(2), getpagesize(2), getconf(1p) cachestat(2)
For bug reports, use the issue tracker
<https://github.com/util-linux/util-linux/issues>.
The fincore command is part of the util-linux package which can be
downloaded from Linux Kernel Archive
<https://www.kernel.org/pub/linux/utils/util-linux/>. This page is
part of the util-linux (a random collection of Linux utilities)
project. Information about the project can be found at
⟨https://www.kernel.org/pub/linux/utils/util-linux/⟩. If you have a
bug report for this manual page, send it to
util-linux@vger.kernel.org. This page was obtained from the
project's upstream Git repository
⟨git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git⟩ on
2025-08-11. (At that time, the date of the most recent commit that
was found in the repository was 2025-08-05.) If you discover any
rendering problems in this HTML version of the page, or you
believe there is a better or more up-to-date source for the page,
or you have corrections or improvements to the information in this
COLOPHON (which is not part of the original manual page), send a
mail to man-pages@man7.org
util-linux 2.42-start-521-ec46 2025-08-09 FINCORE(1)
Pages that refer to this page: mincore(2), posix_fadvise(2)