1 / 21

Virtual Memory

Virtual Memory. By: Dinouje Fahih. Definition of Virtual Memory.

Download Presentation

Virtual Memory

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Virtual Memory By: Dinouje Fahih

  2. Definition of Virtual Memory • Virtual memory is a concept that, allows a computer and its operating system, to use a very large range of memory or storage addresses for stored data. The computing system maps the programmer's virtual addresses to real hardware storage addresses (Hard Disks). • In addition to managing the mapping of virtual storage addresses to real storage addresses, a computer implementing virtual memory or storage also manages storage swapping between active storage (RAM) and hard disk or other high volume storage devices

  3. All modern general-purpose computer operating systems use virtual memory techniques for ordinary applications, such as word processors, spreadsheets, multimedia players, accounting, etc • Older operating systems, such as DOS of the 1980s, or many mainframe operating systems of the 1960s, had no virtual memory functionality. • Embedded Systems and other special-purpose computer systems which require very fast, very consistent response time do not generally use virtual memory.

  4. Computer Memory Hierarchy

  5. Virtual Memory Usage. • Memory Extension • Memory Protection

  6. How Does it Work? • Memory Management Unit (MMU) Hardware component responsible for handling accesses to memory requested by the (CPU). One of Its functions include translation of virtual addresses to physical addresses (Virtual Memory management),

  7. Virtual Memory provides expansion of Main Memoryby ‘overflowing’ data and program code onto Magnetic Disk. • The area on disk reserved for this purpose is known as the Swap Space • Dividing main memory into Frames (pages)

  8. Pages The RAM physical memory subdivided into 4kb-64kb pages. 512MB/4K = 131072 pg • Page Table provides a look up whereby the logical page number can be exchanged for the physical frame number. It is an Array of (PTE).

  9. Process • When programs are using the CPU at the same time, each running program and the data structures needed to manage it. • Addresses • ALoad Instruction • A Store Instruction • Fetching an Instruction

  10. Virtual Memory Address Translation Maximum Virtual Address space: Size of a program address is determined by the maximum size of the virtual address space. The number of bits in a virtual address is the log base 2 of this value. Maximum Physical Address space: The amount of real memory that the system can support determined the number of bits needed to address the physical memory. The size of physical address is log base 2 of this value. Size of a Page: This is the size of a virtual memory page and a physical memory frame. It is always a power of 2

  11. Page number and page offset • A virtual address is therefore split into two parts. The more significant part gives the page number. The less significant part gives the address of the byte within the page. The less significant part is also called the “page offset.” • The number of bits allocated to the page offset should be able to address every byte in the page. Therefore, in our example. Since we have 4 KB = 212 byte page tables, we need 12 bits for page offset. • Likewise for the physical address.

  12. 16MB Maximum Virtual Address space (24 bits) 8MB Maximum Physical Address space (23 bits) 1024byte Page size (10 bits) Virtual Address can be represented as:

  13. Page Fault • The memory manager locates the missing page in secondary memory. • The page is loaded into primary memory, usually causing another page to be unloaded. • The page table in the memory manager is adjusted to reflect the new state of the memory. • The processor re-executes the instructions which caused the page fault.

  14. Translation Look-aside Buffer • The TLB tends to be fully associative. • The TLB uses write-back. • Therefore, needs a dirty bit to indicate if the page is dirty • Or have a Read or Write Permission bit • This is because a TLB miss is very costly, and is to be avoided.

  15. MEMORY PERFORMANCE COMPARISON

  16. How to Access the Virtual Memory in your Computer? 1

  17. 3 2

  18. 4

  19. Conclusion! Questions??

More Related