Know how Virtual Memory Works


This article gives the definition of Virtual Memory, explains how it works, also pin points the advantages and disadvantage of virtual memory.


Virtual Memory


Virtual memory is one of the most significant memory management technique that is used by an operating system. In a common parlance we can say that virtual memory is nothing but the space on the hard disk that is used as Physical Memory address by the operating system. It is very useful technique not only from the performance point of view but also for cutting costs. In this technique hard disk space is used as memory of the of system. The cost of Hard Disk is quite cheap as compared to that of the RAM (Random Access Memory). So using this technique we can have the benefits of much larger RAM even if we have a small sized RAM and enough Hard Disk space.

Virtual memory is also known as swapped memory or swap space in computing terminologies. Thus virtual memory is a combination of RAM and some reserved space on the Hard Disk. This reserved space on the disk is usually termed as the Swap Space.

Why Virtual Memory is needed?


When a program is to be executed by the CPU, it needs to be uploaded in the memory. There is a program called Loader whose job is to load a particular program in the memory. Now think of a program which very large in the size say larger than the size of your physical memory. What would happen then, the CPU won't be able to load the program in the memory as there is not enough space available in the memory. Therefore that program can not be run in your system.

To overcome such a situation the memory management technique like virtual memory came into picture. This helps to execute a program even larger than the size of RAM or physical memory of your system. Virtual memory technique utilizes the hard disk space of the system to load programs.

The researchers have observed that not the whole program needs to be loaded in the RAM on any given point of time. A program can be executed even if a portion that is referenced currently is loaded in the memory. Virtual memory utilizes this and swaps out the portion of the program that are not currently needed to the hard disk.

How Virtual Memory works?


Virtual Memory Implementation

To run a process CPU needs to be loaded into the physical memory. A processes is comprised of the programs ( set of instructions ) and data structures that manage it. Each process is allocated a valid addresses in the memory.

When a program starts its execution memory address is generated for it. These addresses are logical addresses which is translated into the physical address by referring the page allocation table. But the running program doesn't know the difference between the logical and physical address. It thinks that it accessing the physical address.

Virtual memory uses paging technique. Paging is also one of the very important memory management technique. It helps to store and retrieve data from the Hard Disk. The whole memory in divided into equal size of chunks known as a page.One of the most significant benefit of paging is that it allows the memory address to be Non contiguous. If there is not enough space on the physical memory the space from the hard disk is allocated by the memory manager.

How much space should be allocated as Virtual Memory:



You can allocate as much space available from your hard disk to Virtual Memory. But, performance wise it is highly recommended that the Virtual Memory should be Twice the size of your RAM.

For example, if your RAM size is 1GB than the size of your virtual memory should be 2 GB.

Advantages of Virtual Memory:


  • First and the most significant advantage of Virtual Memory is that you can run a program that is larger than the the size of your RAM.

  • Different processes get separate memory spaces allocated to them.

  • The cost is reduced quite significantly. Because the cost of Hard Disk is quite cheaper than the RAM

Disadvantages of Virtual Memory:


The only disadvantage of Virtual Memory is that your program execution become a bit slower. This caused by of the slow speed of Hard Disk as compared to that of the physical memory or RAM.

How to set Virtual Memory of your System:


If you are a windows user you can easily set up the size of Virtual Memory of your system. Just follow the steps mentioned below and you are done:

Step 1: Right Click on "My Computer"

Step 2: Click on Advance Tab.

Step 3: Click on the Setting of the Performance Tab

How to set Virtual Memory of your system_1

Step 4: Click on Advance Tab.

Step 5: Under the Virtual Memory Tab you can see the current size of your Virtual Memory of the system

Step 6: Click on Change button.

How to set Virtual Memory of your system_2

Step 7: Select the radio button Custom size.

Step 8: Enter the Initial Size and Maximum size in MBs for your Virtual Memory. Click on the radio button for System Manged sized or No paging file whatever you want.

Step 9: Click Ok

How to set Virtual Memory of your system_3

Step 10: Restart your system.

That's it you have set the size of Virtual Memory for your system.


Related Articles

How to improve memorizing skills

In this article I am going to discuss about simple steps that can help anyone to improve his memorizing abilities. These days people complain about their weak memory power and tell that they cannot keep facts for a long time in their minds. Therefore some simple steps can help anyone to improve their skills in memorizing and in this way they can get rid of their weak memory problems.

Methods to improve Memory / Brain Power

A good memory is a very good tool for a student as well as any one in any profession. In this article I have written about how to improve your memory power. Children usually studies every thing but unable to produce it in the Answer sheet because of poor memory power. Here we will learn some simple steps to increase your memory power.

How can memory be improved?

Every body wants to improve their memory. Memory shows the power of man, so below I have mentioned some basics skills to improve your memory, which will affect your regular life as well as professional life.

How To Boost Up Memory Power The Ayurveda Ways

Don't worry from your weakening memory loss. Some old Ayurvedic treatments help augment your memory power! By treating yourself with these, you can build your memory power angular. This article has the full details of how you can regain your memory loss the Ayurveda ways.

How to memorize things and objects quickly?

In this article, I will discuss how one can memorize things easily and efficiently. By following a few simple techniques, one can increase his capacity to learn and remember.

More articles: Memory

Comments



  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: