In short: is the process virtual address space continuous?
I need to know something about the virtual address allocated to the process by the kernel. Please correct me if I am wrong when I continue.
When creating a process, the kernel allocates virtual memory in the process and saves the starting and ending values โโof the virtual addresses of various segments of the process in mm_struct in task_struct .
Now say that the process has ended from the heap, and it needs to increase the size of the heap. .
If the range of virtual addresses is contiguous, is this a new allocated piece of the heap provided from outside the range that was originally allocated for this process? Or it is highlighted in such a way that the new fragment is next to the original. What to do if there is no space for this (since there is a segment with a memory display). How is it tracked? If the virtual address range is not in contact, how vm_struct track the various fragments of the address ranges for the heap (or any other segment)?
Can you clarify my concept?
source share