1N/AThe following is a demonstration of the anonpgpid.d script,
1N/A
1N/A
1N/AHere we run it on a system that is implementing memory caps using the
1N/Aresource capping daemon, "rcapd",
1N/A
1N/A # anonpgpid.d
1N/A Tracing... Hit Ctrl-C to end.
1N/A ^C
1N/A PID CMD D BYTES
1N/A 6215 bash R 8192
1N/A 6215 bash W 126976
1N/A 5809 rcapd R 245760
1N/A 6222 memleak.pl R 974848
1N/A 6222 memleak.pl W 3055616
1N/A
1N/AThe "memleak.pl" process consumes memory, and we can see above that it has
1N/Aencountered both reads and writes to the physical swap device - it is being
1N/Apaged out. A bash shell was also effected (which was in the same project that
1N/Arcapd was monitoring).
1N/A
1N/A
1N/A
1N/AThe following is an ordinary system that is very low on memory,
1N/A
1N/A # anonpgpid.d
1N/A Tracing... Hit Ctrl-C to end.
1N/A ^C
1N/A PID CMD D BYTES
1N/A 18885 sendmail R 4096
1N/A 18600 automountd R 4096
1N/A 1 init R 4096
1N/A 2456 inetd R 8192
1N/A 18546 nscd R 8192
1N/A 2400 bash R 12288
1N/A 217 utmpd R 28672
1N/A 221 ttymon R 32768
1N/A 210 sac R 36864
1N/A 18777 snmpd R 49152
1N/A 18440 init R 49152
1N/A 89 nscd R 61440
1N/A 318 syslogd R 73728
1N/A 487 snmpd R 81920
1N/A 2453 inetd R 102400
1N/A 165 in.routed R 131072
1N/A 294 automountd R 135168
1N/A 215 inetd R 135168
1N/A 187 rpcbind R 204800
1N/A 86 kcfd R 290816
1N/A 7 svc.startd R 1015808
1N/A 9 svc.configd R 1478656
1N/A 2 pageout W 23453696
1N/A
1N/AThe "pageout" process is responsible for writing all the anonymous memory
1N/Apages to the physical swap device, and we can see from the above that it
1N/Ahas written 23 Mb. When processes access anonymous memory that has been
1N/Aswapped out, a major fault occurs and the memory is paged back in; in this
1N/Acase we can trace the process that was effected, and from the above we can
1N/Asee that several processes have been effected by the memory pressure.
1N/AThe most is "svc.configd", which needed to page back in 1.4 Mb of anonymous
1N/Amemory.
1N/A
1N/A
1N/A
1N/ASometimes anonpgpid.d doesn't help too much. Here we only have pageouts
1N/Ato the physical swap device and no pageins,
1N/A
1N/A # anonpgpid.d
1N/A ^C
1N/A PID CMD D BYTES
1N/A 2 pageout W 61083648
1N/A
1N/AOnly pageout is identified.