Linux page cache
Linux (and most other operating systems) provide a transparent layer of caching for auxiliary storage (hard drives, etc…). This layer allows fast access to frequently used files on disk by keeping their content in memory and reading from there when necessary.
The kernel can use any free space in RAM as page cache. If the system requires more memory, the kernel might free space used by this cache and provide it to the application that needs it.
Inspecting page cache
Page cache is stored in RAM, but the space can be reclaimed by the kernel for applications whenever necessary. In Linux we can see how many bytes of RAM are used for page cache:
1
2
3
4
~ $ free -h
total used free shared buff/cache available
Mem: 19G 5.4G 7.8G 1.5G 6.2G 12G
Swap: 19G 0B 19G