Re: Application base address question
On Tue, 23 Jan 2007 21:10:20 -0800, "Polaris" <etpolaris@hotmail.com>
wrote:
Hi Experts:
I'm looking at a list of running processes on Windows XP and noticed that
multiple applications have the same base addresses. Does this make sense?
How could multiple applications be loaded at the same base address.
Virtual memory. In Windows (and most any modern OS), a process's address
space is a linear logical space divided into pages of a fixed size,
typically 4 KB, and those pages may or may not be backed by physical memory
pages, also the same size, but usually not at the corresponding physical
address. That is, while the virtual address space is linear, the mapping to
physical memory is not, and contiguous, committed virtual memory may not be
represented by contiguous physical memory. The CPU's memory management unit
(MMU) translates logical addresses into physical addresses by consulting
the process's page table, which represents this mapping. So when the CPU
switches to a thread belonging to a different process, it loads a pointer
to that process's page table, and this page table governs the address
translation for the thread's memory accesses. So even though the thread
uses the same logical addresses as a thread belonging to a different
process, it refers to different physical memory, thanks to the page table
mapping. Any OS text will describe this in far more detail, and I'll bet
you'll find a lot of info if you Google for "page table", MMU, "virtual
memory", "translation lookaside buffer", etc.
--
Doug Harrison
Visual C++ MVP