In this tutorial we are going to learn about virtual memory and buffer memory.
Storage allocation has always been an important consideration in computer system. The cost of main memory is higher than the cost of secondary storage. Every program during execution must reside in the main memory. But problem is, the main memory may not be large enough to accommodate the contents of all running programs. Even with the improvements in hardware technologies, machine resources are still finite. It is necessary to share a smaller amount of physical memory among many processes. This process being the given the appearance of having their own executive address space. To overcome memory related conditions the concept of virtual memory emerges.
Memory that no longer physically exists within computer system is called virtual memory. Virtual memory is a technique that allows the execution of process that may not be completely in memory. Applications access memory through virtual address, which are translated by special hardware and software onto physical address. Virtual memory automatically manages two levels of the memory hierarchy, representing the main memory (RAM and ROM) and secondary storage (Hard Disk).
The operating system automatically manages the required spaces from secondary storage in the case of main memory is not sufficient to run particular program. But all the internal processes are hidden to the frontend user. Virtual memory systems are two basic kinds – those using fixed-sized blocks called paging and those that using variable-sized blocks called paging and those that using variable sized block called segmentation.
For example, a main memory of 2 Gigabytes required to run a program called Mortal combat but only 512 Megabytes is available from 1 Gigabytes system memory. To create the illusion of larger memory space, the memory manager would divide the required space into units called pages and store the contents of Mortal Combat into secondary storage, The memory manager manages and exchanges the pages that are no longer required.
As shown in the above figure, buffer is a small, high speed memory element and it can be a reserved section of RAM or can be located in the input/output devices. There are input buffer and output buffer in computer system.
As we know that the execution speed of the CPU has been always faster than any other input / output devices. Unless any special technique has been applied, the CPU remains idol most of the time as it has to wait for other slow input / output devices. The technique which is used to keep both the CPU and input/output device busy all the time is called buffering.
Many peripherals have their own buffers. The computer transfers the data to printer from memory into the printer buffer, and the printer then processes that data directly from its own buffer, freeing the computer to do other tasks.
Follow us on: Facebook
Read more about Computer Fundamentals.