Assignment On Virtual Memory

1904 Words8 Pages

Assignment-1 Virtual Memory Management Need of Virtual Memory The memory management subsystem is one of the most important parts of the operating system. For a task to be executed, the Program code and data required for execution of a process must reside in main memory, but main memory may not be large enough to accommodate the needs of an entire process. Multi-tasking and running of large programs becomes difficult with the traditional way of accessing the physical memory. Early programmers divided programs into sections that were transferred into main memory for a period of processing time. The problem of storage allocation became more complex. The programmer ensured that the program never tried to access more physical main memory than …show more content…

The term virtual memory refers to the abstraction of separating LOGICAL memory (Memory as seen by the process) from PHYSICAL memory (Memory as seen by the processor). Virtual Memory Virtual Memory divides physical memory into blocks and allocates them to different processes. Virtual memory was invented to relieve programmers of the burden of ensuring that the program never tries to access more physical memory than the present; it automatically manages the two levels of the memory hierarchy represented by main memory and secondary storage. Implementing Virtual Memory is feasible due to the following reasons: • In practice, most real processes do not need all the program code or at least not all at once. • Error handling code is not needed unless that specific error occurs, some of which are quite rare. The ability to load only the portions of processes that are actually needed (and only when they are needed) has several benefits: • Programs can be written for a much larger address space (virtual memory space) than physically exists on the …show more content…

Shared Virtual Memory Although virtual memory allows processes to have separate (virtual) address spaces, there are times when we require processes to share memory. For example there could be several processes in the system running the bash command shell. Rather than have several copies of bash, one in each processes virtual address space, it is better to have only one copy in physical memory and all of the processes running bash share it. Continuous Memory The process being executed finds the logical memory to be continuous whereas the actual address in the physical memory can reside at any position. Virtual Memory enables programs to execute without requiring the entire address space to be present in the main memory. With virtual memory, the processor produces virtual addresses that are translated by a combination of hardware (Memory Management Unit) and software to physical addresses, which access main memory. This process of Memory Mapping (also known as address translation) is done with the help of MMU and Translation Lookaside Buffer

Open Document