This question is for understanding the kind-off constraints applicable for a Mem-Mapped file in unix environ.
We have an APP running in unix environment that hosts and serves files with Mem-mapped files of Key-Value with read only access, also is capable of refreshing on runtime when a new version of file is copied ( probabaly with more key-value pairs).
What i observe is , since the file is Mem-Mapped , as we refresh the file with more key-value pairs VIRT memory consumption increases with not much RES mem consumption.
PID PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
12948 16 0 43240 9936 2996 S 0.0 0.1 0:00.00 lookup_server
12951 16 0 562m 16m 9972 S 0.0 0.1 0:00.09 lookup_server
As i understand this is because the whole file is copied as virtual memory pages in harddrive , and only few pages that are in demand are in RES mem.
Is my assumptions right , that
- with Mem-Mapping files , the file size is not limited to available physical RAM , as the files would be paged-in/out by the OS on-demand.
- and only limiting factor could be disk space configured for virtual memory. in this case how can i identify the disk space identified by OS for virtual memory extension? where does the virtual memory foot print of the file get stored in harddisk ?