3 ms·
Good explanations of what and why one might lock memory. But, in the context of this overall discussion, I think it's important to keep in mind that when a pro
by scott_s 8y ago
Good explanations of what and why one might lock memory.
But, in the context of this overall discussion, I think it's important to keep in mind that when a process allocates a large amount of virtual memory, it does not automatically allocate any physical memory. So a process allocating a lot of virtual memory up front should not impact other processes which have locked some of their memory into physical memory.
- deathanatos 8y ago> I think it's important to keep in mind that when a process allocates a large amount of virtual memory, it does not automatically allocate any physical memory. It will, if you mlock() it, I believe. The manual page notes "real-time processes" as a main user of mlock() (the other being the cryptographic uses I hinted at); it cites their use case as locking the page to avoid delays due to paging during critical sections. In order for that to work, the OS would need to bring the pages in, at the time of locking; so at that point, a large virtual allocation becomes equivalent to a physical one.
- scott_s 8y agoCorrect, but my point was that a process with allocates a lot of physical memory will not interfere with the other processes that have locked pages.