I program in C++ and run it on Linux CentOS 7.I strictly control the dynamic memory allocation. I Pre-allocate as many memory as needed and re-use the pre-allocated buffer chunks where required.However, I have a data structure, an big array, that I delegate the memory management to OS by exploiting memory mapped file. Note that the remaining physical memory size except for the pre-allocated buffer chunks is smaller than the size of the big array. So the pages of its mmaped region can be paging in/out.During the long running of the program, the big array is often scanned from its beginning to end. Whenever the linear scan on the array occurs, I see the virtual address space size shown on top command increases. What does it mean? I think unless I un-map the memory-mapped file and re-mapping it, its virtual address space must remain the same.Does any one have any thought on it? Did I make any mistake otherwise?
Can a frequent page in/out on the same mmaped file increase VIRT space of a process?
linux;memory;virtual memory