Share to you (asharetoyou) with motto an easy way to share with you is a site About Design, Hardware, Operating System,

Virtual Memory

Written By Share to you on Monday, September 26, 2011 | 1:00 AM


Over the years, the implementation of memory management in essence is to put all the parts of the process to be run into the memory before the process can begin execution. Thus all parts of the process must have its own allocation in physical memory. In reality, not all parts of the program will be processed, for example:

• There are statements or options that will be executed only if certain conditions are met 
• There are functions that are rarely used 
• Allocating more memory than is actually needed. 

In a large-capacity memory, these things would not be a problem. But in memory with a very limited capacity, this will decrease the utility of space optimization of physical memory (main memory). Any programs that run must be in memory. Memory is a place main storage (primary storage) are temporary (volatile). Memory size Restricting the airflow can cause the problem of how to put the program size larger than the size of physical memory (main memory) and application of multiprogramming problem that requires a bigger place in memory. Virtual memory is a technique that separates between logical memory and physical memory.

Logical Memory is a collection of the entire page of a program. Without virtual memory, logical memory will immediately be brought into physical memory (main memory). This is where virtual memory is done by placing the separation of logical memory to secondary storage (secondary disk) and only bring the required page into main memory (physical memory).

This technique puts the whole program on a secondary disk and bring the necessary pages into physical memory so that main memory will only store the most frequently used addresses the process and others will be stored in secondary disk and can be taken as needed. So if the processes that are running require instruction or data contained on a particular page then the page will be sought in the main memory. If the desired page does not exist it will be searched to the secondary disk.


Picture 1. Virtual Memory 


In the picture above indicated a virtual memory space is divided into equal parts and identified with the number of virtual pages. Physical memory is divided into page frames of the same size and are identified by number page frames. Frame  storing data from the page. Or virtual memory to map virtual pages to number number page frames. Mapping  lead to a virtual page can have only one physical address location. In a paging system, if a space is needed for the process and the pages in question are not being used, then the pages of the process would have paged out (saved to disk) or swap out, the memory will be empty for the current page to another. Pages that moved from disk into memory called paged in when required (returned to memory) or swap-in. When an item can have paging, then the item is included in the items that occupy a virtual space, which is accessed with virtual addresses and the room is allocated for mapping information. The operating system allocates the address of the item only when items are experiencing paging in. Gains derived from the storage program is only partially on physical memory it is:

• Decreasing the M / K is needed (traffic M / K is low)
• Space to be more liberal because of reduced physical memory that is used
• Increased response due to reduced loads I / O and memory
• Increased number of users that can be served. Memory space that is still widely available allows the computer to receive more requests from users.

Virtual memory techniques will facilitate the work of a programmer when large data and the program is beyond the capacity of main memory. A multiprogramming can implements virtual memory techniques so that multiprogramming system becomes more efficient. For example: 10 programs with a size of 2 MB can be running in memory capacity of 4 MB. Each program is allocated 256 Kbyte and section - part of the process (swap in) enter into physical memory as needed and will be out (swap out) when not needed. Principle of virtual memory is that "The maximum speed ekseskusi process in virtual memory can be the same, but will never exceed the speed of execution the same process in a system that does not use virtual memory".
Virtual memory can be implemented in two ways:

1. Demand Paging is by applying the concept of pages in the process
2. Demand segmentation, more complex segments of varying sizes are applied.

If you want to know about  Demand Paging and Demand segmentation. pleas read my other article.

No comments:

Post a Comment

Share to you with motto an easy way to share with you is a site About Design, Hardware, Operating System,