130 likes | 323 Views
University of Palestine College of applied engineering & urban planning Software engineering. Working by: Mohammed .Mamdoh Al-Azaiza Dr Supervisor Eng. Mohammed Timraz. Virtual memory. Contents. 1. Virtual memory definition. 2. Main issues in VM design. Some of Algorithm use. 3. 4.
E N D
University of Palestine College of applied engineering & urban planning Software engineering Working by: Mohammed .Mamdoh Al-Azaiza Dr Supervisor Eng. Mohammed Timraz Virtual memory
Contents 1 Virtual memory definition 2 Main issues in VM design Some of Algorithm use 3 4 Why Virtual Memory? Advantages 5 6 Disadvantages Implementation 7
Virtual memory definition • Virtual memory is part of a friendly in most operating systems, but when you run several programs at one time and had little memory and do not have virtual memory will not work these programs and you will get a message asking you to close some applications for the Liberation of memory, with virtual memory computer will search for the parts not used continuously RAM and is copied on the hard drive by use some of algorithm, and this releases a part of the RAM to be used in the operation of add-on applications, this happens automatically. • Use part of H.D logically to make it main memory, in case the main memory is full. • Area on the hard disk which stores the virtual memory called the page file is that the reservation pages of RAM on the hard drive in the Windows system files of this type the parts of the buffer memory is a stretch. SWP
Main issues in VM design • Address mapping • How to translate virtual addresses to physical • Placement • Where to place a portion of VM needed by process • Replacement • Which portion of VM to remove when space is needed • Load control • Determines the number of processes that will be resident in main memory • Sharing • How can processes share portions of their VMs
Some of Algorithm use • Page Replacement Algorithms. • First-In-First-Out (FIFO) Algorithm. • Optimal Algorithm. • Replace page that will not be used for longest period of time. • Least Recently Used (LRU) Algorithm • Clock.
Why Virtual Memory (VM)? • Shortage of memory • Efficient memory management needed • Process may be too big for physical memory • More active processes than physical memory can hold • Requirements of multiprogramming • Efficient protection scheme • Simple way of sharing
VM: Advantages VM supports Swapping Protection Sharing Increased CPU utilization The main memory can execute a process bigger than its own capacity. More processes can be maintained in the main memory
Swapping • Danger: Thrashing: • „Piece“ just swapped out is immediately requested again • The processor spends most of its time swapping pieces rather than executing user instructions,no real work is done • Thus: „piece“for swap out has to be chosen carefully • keep track of „piece“ usage („age of piece“) • Hopefully „piece“ used frequently lately will be used again in near future (principle of locality!)
Protection Each process has its own virtual address space Processes invisible to each other Process cannot access another processes memory „Pieces“ can be protected from being written to or being executed or even being read. System can distinguish different protection levels (user / kernel mode)
Sharing Copy on write: „piece“ may be used by several processes until one writes to it (then that process gets its own copy),but not in one time. Simplifies interprocess-communication (IPC)
VM: Disadvantages Memory requirements (mapping tables) Longer memory access times
VM: Implementation • 1. Paging VM may be implemented using • 3. • Combination of both • 2. • Segmentation