Understanding Linux page cache memory

If data is written, it is first written to the Page Cache and managed as one of its dirty pages. Dirty means that the data is stored in the Page Cache, but needs to be written to the underlying storage device first. The content of these dirty pages is periodically transferred (as well as with the system calls sync or fsync) to the underlying storage device.

 $ dd if=/dev/zero of=demofile.txt bs=1M count=20
20+0 records in
20+0 records out
20971520 bytes (21 MB, 20 MiB) copied, 0.0320754 s, 654 MB/s
 $ cat /proc/meminfo | grep Dirty
Dirty:              1092 kB
 $ sync 
 $ cat /proc/meminfo | grep Dirty
Dirty:                 0 kB

Leave a Comment