Answer the question
In order to leave comments, you need to log in
Virtual memory in Linux?
Two processes can share a memory mapping, that is, two processes can use the same pages of physical memory loaded with data from a file, provided that the following conditions are met in both processes:
Answer the question
In order to leave comments, you need to log in
Under what conditions are two regions in the same process mapped to the same physical memory?
The mapping is readable but not writable.
The mapping is of type 'Private copy on write'.
I think it should be common. But you can, just in case, check: make two mmap'a in one process and see the amount of memory used.
But, perhaps, it is worth considering that the application does mmap once and then transfer pointers to memory to those places where the file is used.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question