I have an application that mmap
s a large read-only data structure into memory and reads parts of it. After some time, around 1 GB of physical memory is filled with pages loaded from this data structure. When the amount of free memory on that machine drops below a certain threshold (~750 MB or so), the kernel seems to release all (or almost all) pages loaded through mmap
.
How does Kernel decide when to start unloading mmapped pages? Is there a way to control that threshold? (e.g. anything in /proc/sys/vm
or cgroups
)