4

Now that I can know the overall cached pages of the system by /proc/meminfo, can I further know for a specific process how many page caches does it consume? My first thought is to add up all the RSSes in smaps of a process. Any more suggestions? Thanks.

Bill Randerson
  • 1,028
  • 1
  • 11
  • 29

2 Answers2

0

@Bill Randerson, Maybe you can try the below command, will get some information regarding Vm, signals and so on ... regarding a particular process.

cat /proc/<process_pid>/status
Gautham Kantharaju
  • 1,735
  • 1
  • 21
  • 24
  • /proc//status indeed contains quite a lot of information of a process, it contains below information of memory: VmPeak: 1079428 kB VmSize: 1063812 kB VmLck: 0 kB VmPin: 0 kB VmHWM: 84572 kB VmRSS: 57320 kB VmData: 150312 kB VmStk: 8196 kB VmExe: 12 kB VmLib: 68332 kB VmPTE: 312 kB VmSwap: 14896 kB But I don't think anyone of them indicates page cache, right? – Bill Randerson Sep 01 '15 at 02:34
  • True, none of them indicate page cache. I guess, at present, system wide page cache information can be retrieved rather than per process. I tried commands 1) free -m before writing 10MB of data into a file 2) dd if=/dev/zero of=testfile.txt bs=1M count=10000, meanwhile executed 3) free -m. Then I could clearly see cache value been increased with 10 (in MB). But this exercise gives system wide page cache information but not per process. – Gautham Kantharaju Sep 01 '15 at 08:44
0

https://github.com/silenceshell/hcache

Usage:

./hcache --pid <pid>
hunter_tech
  • 103
  • 6