loadmem prints out load averages that describe the current saturation levels of the virtual memory system. The values reported is based on the page out scanner's scan rate. The first example shows loadmem running with a sample interval of 1 second on a quiet system. There is no history of samples in the kernel, so loadmem needs to run for some time (15 minutes) before it can fill all the columns. We finish by running vmstat to confirm there is no current demand for memory. $ ./loadmem 1 Mem Time 1sec 5sec 15sec 1min 5min 15min 22:20:28 0.00 22:20:29 0.00 22:20:30 0.00 22:20:31 0.00 22:20:32 0.00 0.00 22:20:33 0.00 0.00 22:20:34 0.00 0.00 22:20:35 0.00 0.00 22:20:36 0.00 0.00 22:20:37 0.00 0.00 22:20:38 0.00 0.00 22:20:39 0.00 0.00 22:20:40 0.00 0.00 22:20:41 0.00 0.00 22:20:42 0.00 0.00 0.00 22:20:43 0.00 0.00 0.00 22:20:44 0.00 0.00 0.00 ^C $ vmstat 1 kthr memory page disk faults cpu r b w swap free re mf pi po fr de sr dd dd f0 s1 in sy cs us sy id 0 0 0 506848 73704 1 5 2 0 0 0 0 0 0 0 0 406 977 184 0 1 99 0 0 0 468856 87632 0 7 0 0 0 0 0 0 0 0 0 407 1274 226 2 0 98 0 0 0 468856 87632 0 0 0 0 0 0 0 0 0 0 0 401 1257 202 1 0 99 0 0 0 468856 87632 0 0 0 0 0 0 0 0 0 0 0 405 1363 213 2 0 98 0 0 0 468856 87632 0 0 0 0 0 0 0 0 0 0 0 401 1314 198 1 0 99 In this example we run loadmem with a 5 second interval. Then an application is executed which gradually uses more and more memory. This exhausts the free memory lists and triggers the page out scanner, generating load seen in loadmem and scan rate seen in vmstat. $ ./loadmem 5 Mem Time 1sec 5sec 15sec 1min 5min 15min 22:50:28 0.00 0.00 22:50:33 0.00 0.00 22:50:38 0.00 0.00 0.00 22:50:43 0.00 0.00 0.00 22:50:48 0.00 0.00 0.00 22:50:53 0.00 0.00 0.00 22:50:58 0.00 0.00 0.00 22:51:03 0.00 0.00 0.00 22:51:08 0.00 0.00 0.00 22:51:13 16.23 8.39 2.80 22:51:18 13.54 14.73 7.71 22:51:23 0.00 10.03 11.05 2.76 22:51:28 0.00 0.00 8.25 2.76 22:51:33 0.00 0.00 3.34 2.76 22:51:38 0.00 0.00 0.00 2.76 22:51:43 0.00 10.90 3.64 3.67 22:51:48 0.00 0.00 3.64 3.67 22:51:53 0.00 0.00 3.64 3.67 22:51:58 0.00 0.00 0.00 3.67 ^C $ vmstat 5 procs memory page disk faults cpu r b w swap free re mf pi po fr de sr f0 s3 s6 -- in sy cs us sy id 0 0 0 268004 159152 4 26 9 0 0 0 0 0 1 0 0 110 30 24 1 1 99 0 0 0 123452 13856 0 2 0 0 0 0 0 0 0 0 0 116 41 47 0 0 100 0 0 0 121620 12072 6 139 0 0 0 0 0 0 0 0 0 112 71 36 1 2 97 0 0 0 120244 10732 6 139 0 0 0 0 0 0 0 0 0 109 62 30 2 2 96 0 0 0 117492 8052 6 139 0 0 0 0 0 0 0 0 0 110 62 26 1 2 97 0 0 0 116568 7152 0 0 0 0 0 0 0 0 0 0 0 108 25 27 0 0 100 0 0 0 115192 5808 5 139 4 0 0 0 0 0 3 0 0 120 62 28 2 2 96 0 0 0 113096 3932 5 139 3 0 5 0 917 0 1 0 0 113 65 34 2 3 95 0 0 0 111984 2732 0 0 0 0 10 0 1460 0 0 0 0 109 32 35 0 2 98 0 0 0 111984 2904 0 0 0 124 134 0 936 0 1 0 0 114 20 28 0 2 98 0 0 0 111984 3424 0 0 0 0 0 0 0 0 0 0 0 107 22 23 0 0 100 0 0 0 111984 3424 0 0 0 0 0 0 0 0 0 0 0 107 25 27 0 0 100 0 0 0 111984 3424 0 0 0 0 0 0 0 0 2 0 0 112 19 20 0 0 100 0 0 0 110140 7684 5 139 5 2704 2997 0 1094 0 23 0 0 299 62 48 2 9 89 0 0 0 109676 16160 0 0 0 0 0 0 0 0 0 0 0 107 21 25 0 0 100 0 0 0 109672 16156 0 0 0 0 0 0 0 0 0 0 0 106 23 23 0 0 100 0 0 0 107392 13936 2 138 16 0 0 0 0 0 3 0 0 119 58 30 2 2 96 0 0 0 107392 13936 0 0 0 0 0 0 0 0 0 0 0 107 19 24 0 0 100 0 0 0 107392 13936 0 0 0 0 0 0 0 0 2 0 0 112 19 21 0 0 100 This example runs loadmem with a 1 second interval. Here we run a program that quickly uses 80Mb of memory for a couple of seconds. $ ./loadmem 1 Mem Time 1sec 5sec 15sec 1min 5min 15min 22:10:07 0.00 [...] 22:10:38 0.00 0.00 0.00 22:10:39 0.00 0.00 0.00 22:10:40 83.59 16.72 5.57 22:10:41 38.64 24.44 8.15 22:10:42 0.00 24.44 8.15 22:10:43 0.00 24.44 8.15 22:10:44 0.00 24.44 8.15 22:10:45 0.00 7.73 8.15 22:10:46 0.00 0.00 8.15 22:10:47 0.00 0.00 8.15 22:10:48 0.00 0.00 8.15 22:10:49 0.00 0.00 8.15 ^C $ vmstat 1 kthr memory page disk faults cpu r b w swap free re mf pi po fr de sr dd dd f0 s1 in sy cs us sy id 0 0 0 506856 73704 1 5 2 0 0 0 0 0 0 0 0 406 977 184 0 1 99 0 0 0 467368 76936 0 7 0 0 0 0 0 0 0 0 0 407 1281 232 0 2 98 0 0 0 467360 76928 0 0 0 0 0 0 0 0 0 0 0 410 1327 263 1 2 97 2 0 0 467104 76800 18 4988 0 0 0 0 0 0 0 0 0 404 1469 240 40 38 23 0 0 0 392824 22728 0 4325 0 0 697 0 5853 2 0 0 0 410 1280 213 23 41 37 0 0 0 393184 3768 0 0 0 2408 3747 0 6247 19 0 0 0 440 1336 224 1 4 95 0 0 0 393184 8552 1 2 0 4444 4444 0 0 36 0 0 0 474 1434 230 1 11 88 0 0 0 467720 86256 0 0 0 0 0 0 0 0 0 0 0 406 1606 220 1 0 99 0 0 0 467720 86256 0 0 0 0 0 0 0 0 0 0 0 402 1396 205 1 0 99