简言之,一个过程的虚拟空间是否毗连?
我需要了解一些关于花旗为这一进程分配的虚拟地址。 如果在我工作时我错了,请更正。
On process creation, the kernel allocated virtual memory to the process and stores the starts and ends of the virtual addresses of the different segments of the process in the mm_struct
in the task_struct
.
Now say the a process has run out of the heap and needs to increase the heap size.calls brk()
.
If the virtual address range is contiguous, is the newly allocated chunk of heap provided from outside the range that was allocated originally for this process? Or is it allocated in a way that the new chunk is adjacent to the original one. What if there is no space for that (because the memory mapped segment is lying there). how is it kept track of?
If the virtual address range is not contiguous, how does the vm_struct
keep track of the different chunks of the address ranges for the heap (or any other segment)?
Can you please clear my concept on that?