Differences between revisions 4 and 5
Revision 4 as of 2004-03-15 23:35:59
Size: 2754
Editor: yakko
Comment:
Revision 5 as of 2004-03-16 00:08:55
Size: 3205
Editor: yakko
Comment:
Deletions are marked like this. Additions are marked like this.
Line 42: Line 42:
Why do you think that the virtual memory space would be smaller than the physical memory space? The best answer that I can come up with is that you may not want a program to have access to all of the memory. This is not the case in windows, but it maybe the case for an SGI super computer (I don't know that for sure) where you have 16 GB of physical memory, but individual processes are not allowed to use (in general) more than 2 GB. Just a thought.

Back to ComputerTerms

Virtual Memory

There are two main motivations for Virtual Memory:

  1. To allow efficient and safe sharing of memory among multiple programs
  2. To remove the programming burdens of a small, limited amount of main memory.

Virtual memory implements the translation of a program's address space to physical addresses. This translation process enforces protection of a program's address space from other programs.

In times past programmers had to make sure their programs fit in the memory available, Virtual memory overcomes this by relieving the programmer of this task.

KEY: A Virtual Memory Block is called a page

KEY: A Virtual Memory Miss is called a page fault

KEY: The CPU produces a Virtual Address.

The process of mapping virtual memory addresses to physical memory address is called memory mapping or address translation. Virtual memory also provides relocation functionality. This allows us to load the program in any physical memory location (remember that DOS required you to run your program in the lower 640K of memory). Further memory is allocated in fixed size blocks (pages) eliminating the need to find a contiguous block of memory to allocate to a program. (Remember that memory references in a program are offsets that assume contiguous memory use.)

FORMAT:

Virtual Page Number

Page Offset

Note that since physical memory is allocated in pages, that the page offset for virtual and physical addresses don't change.

https://www.scotnpatti.com/images/vitualMemorytranslation.jpg

Essentially Memory is a cache for the disk drive system. When we view it in this way we need to consider the extreme difference in speed between the memory and the disk drive. To minimize the effects of this difference we employ the following techniques:

  • Pages should be large enough to amortize the high access time.
  • Page placement is fully associative
  • Page faults can be handled in software because the overhead will be small compared to the disk access time
  • The Write-through method will not work with virtual memory since writes take too long. Instead VM systems use write-back schemes.

Page Table

It is impractical to search the entire memory for a specific entry when translating a virtual address into a physical address as is needed in a fully associative cache. Instead we locate pages by using a full table that indexes the memory, called a page table. P583 Computer Organization and Design state: "Each program has its own page table, which maps the virtual address space of that program to main memory."

https://www.scotnpatti.com/images/pagetable.jpg

Why do you think that the virtual memory space would be smaller than the physical memory space? The best answer that I can come up with is that you may not want a program to have access to all of the memory. This is not the case in windows, but it maybe the case for an SGI super computer (I don't know that for sure) where you have 16 GB of physical memory, but individual processes are not allowed to use (in general) more than 2 GB. Just a thought.

Back to ComputerTerms

VirtualMemory (last edited 2004-03-29 19:59:20 by yakko)