Last month we introduced some of the concepts that are involved with memory management. We discussed how to dynamically allocate memory in your applications. We also described the various methods that allocators use to manage free memory. This month we turn our attention to memory allocation at a lower level — the level of the operating system.
Last month we introduced some of the concepts that are involved with memory management. We discussed how to dynamically allocate memory in your applications. We also described the various methods that allocators use to manage free memory. This month we turn our attention to memory allocation at a lower level — the level of the operating system.
In all our discussions of memory allocation techniques, we never addressed the question, “Where does the allocator get actual blocks of memory to give to your application?” This month, we will answer that question by delving deeper into the relationship between the memory allocator and the operating system.
Every Linux process has its own dedicated memory address space. The kernel maps these “virtual” addresses in the process address space to actual physical memory addresses as necessary. In other words, the data stored at address 0xDEADBEEF in one process is not necessarily the same as the data stored at the same address in another process. When an attempt is made to access the data, the kernel translates the virtual address into an appropriate physical address in order to retrieve the data from memory. In this column, we are not really concerned with physical addresses. Rather, we are investigating exactly how…
Please log in to view this content.
Not Yet a Member?
Register with LinuxMagazine.com and get free access to the entire archive, including: