Need help in understanding virtual memory concept.When a process requesting for 2GB mapping onto the virutal memory in Linux environment of 4GB ( 1GB Kernel : 3GB Userspace), when already another process already holds the mapping for 2 GB.How does the mapping of the stack, heap, data segments all going to happen?I am not able to find any example for my understanding.Text book only mentions separately for each mapping but not a practical approach.It would be of great help to understand one practical example with great difficulty than to simply read the text book and articles.
Case study of virtual memory management
linux kernel;virtual memory
Let's assume that we have 3 GiB of virtual address space available and that a process' text, stack, heap, and prior memory mappings together occupy only a small amount of address space (much less than 1 GiB). Then if this process requests a mapping of size 2GB then there is no problem, there is plenty of space to accommodate that mapping.(Actually, there would be one small case where this is not true: if the process' existing mappings were fragmented and scattered around the address space and there was no contiguous 2GB range of addresses available. But that's unlikely).What mappings are or are not present in a different process' address space has nothing to do with it.