How to Allocate Virtual Memory

Virtual memory can make a computer program believe that it has a continuous resource of working memory. This memory helps the computer to operate at a faster speed. Virtual memory can help in an efficient use of the RAM of a computer. If you want to know how to allocate virtual memory, you are at the right place.

The virtual memory can also increase the overall computing speed of the computer. Virtual memory makes use of hard disk space to help in providing more RAM memory than installed. It gives the impression to the user that he has got more RAM memory to improve the overall system performance.

Memory versus Disk Space:

When any computer geek talks about computer memory or RAM, we are talking about some silicon chips in the computer. This just stores things like the programs you’re running right now or any open document file or the email you’re going to send. Computers can have memory between 128 MB and 4 GB. Each time you shut down your computer, anything stored in RAM is gone. So, you should save the data to the disk at the time of editing a document.

When we talk about disks, it is the hard disk drives of your machine. A hard disk drive consists of several metal disks coated with a magnetic material. Magnetic thing is just like a video or audio tape or the strip on the back of a credit card. The disk spins at a high speed. The special heads read or record the pattern of bits (1’s and 0’s) on the magnetic material. The OS assembles the bits to bytes and the bytes into the files. Files are something that you might receive or achieve. You do not lose the data when the power is shut down. The disk sizes come in the range of 20 to 400 gigabyte.

Disks are much slower than the memory. In fact, they are too slow to directly work from your computer. So generally, you need to load your program or document into memory from the disk. Then run or process it on memory, and then save the updates back to the disk.

Virtual Memory is just the same as the operating system that uses some amount of disk space as if it is a real memory.Exact implementation of virtual memory is complex.

Now your program requires memory. The operating system tracks which program uses what portions of memory. It allocates the program, the required amount of memory.

As the complexity of the programs increase, they need more memory. When you open a large document, your word processor may request additional memory from the operating system to hold the document.

When there is not enough memory to satisfy a request, the operating system can decide that some other program’s needs are relatively less important. Some memory of that program will be released. This happens by first writing the contents to disk and then allocating the content to the program to complete the request.

Later if the program whose memory we swapped can be swapped in by reading it from the same disk. This can cause the removal of another program’s memory to be written off to the disk.

One more thing to remember is that the operating system is also a program. So it also needs memory. It allocates memory to itself. You can swap the memory of the operating system to the disk depending on the requirement.

As the disks are slower than memory, so when there is too much swapping of memory by the operating system, then computer is surely going to slow down. If it happens frequently or if the computer thrashes, then there might be a need to add some memory to your machine. You can definitely increase the system’s speed through this method.

Systems that employ virtual memory:

  • Results in efficient use of hardware memory
  • Make the application’s programming easy
  • Hiding fragmentation
  • Pass on to the kernel the burden to manage the memory hierarchy. No need to handle program overlays explicitly
  • Preventing the need of relocating program code
  • Preventing the access of memory with relative addressing

How to allocate virtual memory:

You need to single left click the computer icon on the computer’s desktop. Now, right click the icon to choose the properties menu option.

Now choose the “Advanced system settings” option. Select the “Settings” option from the options on the screen.

You have to now choose the “Change” option to change the size of the virtual memory paging file. Now, left click on the check box that you selected for the Windows to manage the computer’s virtual memory.

You now enter the initial and final value for the virtual memory paging files in the text fields. Select the “Enter” button. Now, choose the “OK” button to finish the modification of the computer’s virtual memory.

Thrashing:

The operating system constantly swaps information back and forth between RAM and the hard disk. This is called thrashing. This can make your computer feel incredibly slow. The area of the hard disk which is used to store the RAM is called a page file. It stores the pages of RAM on the hard disk. The operating system exchanges the data back and forth between the page file and RAM. On Windows machine, page files have a .SWP extension.

Always keep a small page file on your main disk. It should be quick especially on random accesses. Even if the disk corrupts, your system still operates effectively. You should not take your entire disk for a page file. 2 MB to 50 MB is a good size to keep on your main disk.

You never want your computer to get overloaded with the running programs. This can hamper the speed of the computer. Your output will surely come in a longer time. You need something like virtual memory to process the programs faster. I am quite sure that by now you get enough on how to allocate virtual memory.


Related Content:

  1. How to Allocate System Memory
  2. How to Allocate Memory in C
  3. How to Allocate Bandwidth
  4. How to Resolve Low Disk Space
  5. How to Prevent Memory Loss
. Tags: .

Leave a Reply