mincore()
can be used to check if certain
pages are mapped in memory or not.
fincore
utility uses this system-call to check what
part of memory a file uses.
lsof
, we can check the entire
contents of the cache:
#!/bin/bash
lsof | grep REG | awk '{print($9)}' | while read fn; do
echo $fn `fincore $fn -justsummarize`
done
/usr/bin/gnome-keyring-daemon page size: 4096 bytes 56 pages, 224.0 kbytes in core for 1 file; 56.00 pages, 224.0 kbytes per file. /lib/libnss_files-2.11.1.so page size: 4096 bytes 12 pages, 48.0 kbytes in core for 1 file; 12.00 pages, 48.0 kbytes per file.
lsof
.