"cache memory" is used to store data from file systems in RAM, and limit I/O access to disks. This memory can be reclaimed by any app which needs the memory for other purposes.
We implement two levels of caching:
- A "block cache", which stores sectors as read from block devices (ie. disks)
- A "file cache", which stores data from files.
The file cache is particularly relevant here, because it will be used to store file content. Because of the package filesystem, it will store them uncompressed. As a result, the decompression of package files is done much less often because the uncompressed data can be stored in RAM. And since an Haiku install is usually quite small (mine is about 3GB), and RAM on modern machines is large, it means that after some time, all the data from packages is loaded in RAM (we can do this because Haiku does not use much RAM for other things). This compensates for the extra work that would occur if we were always reading data from disk and decompressing it over and over again.