3. Example

In one window:
$ ./mem 12000                                    <<-- time 1
allocating 12582912000 bytes (12000.00 MB)
  number of integers in array: 3145728000
loop 0 in 5604.98 ms (bandwidth: 2140.95 MB/s)
loop 1 in 2092.22 ms (bandwidth: 5735.54 MB/s)
loop 2 in 2088.83 ms (bandwidth: 5744.85 MB/s)
loop 3 in 2103.87 ms (bandwidth: 5703.77 MB/s)
^C                                               <<-- time 2
$
In another window:
$ vmstat 1
procs -----------memory----------    ---swap-- -----io---- -system-- ------cpu-----
 r  b   swpd    free    buff   cache   si   so    bi    bo   in   cs us sy id wa st
 1  0 827184 8436620 4084564 2224596    0    2   118    61    3    4  1  1 97  0  0
 0  0 827184 8436496 4084564 2224596    0    0     0     0  181  534  1  0 99  0  0
 0  0 827184 8436364 4084564 2224588    0    0     0     0  307 1054  2  1 96  0  0
 1  0 827184 8441324 4084564 2219468    0    0     0     0  318 1452  4  1 96  0  0
 1  0 827184 7307468 4084564 2224956    0    0     0   127  380  991  8  7 85  0  0  <<-- time 1
 1  0 827184 5073352 4084564 2225108    0    0     0     0  459  773 14 12 74  0  0
 1  0 827184 2856232 4084564 2224596    0    0     0     0  468  503 14 12 74  0  0
 1  0 827184  616916 4084564 2224596    0    0     0     0  463  467 15 11 74  0  0
 2  0 827184  165356 3384604 1191244    0   40     0    43  798 1245 13 20 66  0  0
 2  0 838704  153824 1897456  534920    0 11480  168 11516 1045 1368 13 25 62  0  0
 1  0 840496  258872 1662480  511156    0 1716   794  1717  700  952 25  4 71  1  0
 1  0 840496  258624 1662500  511664    0    0   264     0  458  499 26  0 74  0  0
 1  0 840496  258624 1662632  511664    0    0   132     0  469  468 25  0 74  0  0
 1  0 840496  258624 1662632  511664    0    0     0     0  439  504 25  0 74  0  0
 1  0 840496 10478440 1662632 513316    0    0  1652     0  490  817 17  9 74  0  0  <<-- time 2
 0  0 840496 12568236 1662632 513384    0    0    60     0  253  609  0  3 97  0  0
 0  0 840496 12573568 1662632 507976    0    0     0     3  183  570  1  0 99  0  0
 0  0 840496 12568112 1662632 513268    0    0     0     0  245  980  2  1 98  0  0
^C
$