top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is virtual memory, how is it implemented, and why do operating systems use it?

+3 votes
1,258 views

also please explain Virtual Memory Can Slow Down Performance why and how?

posted Aug 5, 2015 by Mohammed Hussain

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Virtual memory is a technique that allows the execution of processes which are not completely available in memory. The main visible advantage of this scheme is that programs can be larger than physical memory. Virtual memory is the separation of user logical memory from physical memory.

This separation allows an extremely large virtual memory to be provided for programmers when only a smaller physical memory is available. Following are the situations, when entire program is not required to be loaded fully in main memory.

User written error handling routines are used only when an error occured in the data or computation.

Certain options and features of a program may be used rarely.

Many tables are assigned a fixed amount of address space even though only a small amount of the table is actually used.

The ability to execute a program that is only partially in memory would counter many benefits.

Less number of I/O would be needed to load or swap each user program into memory.

A program would no longer be constrained by the amount of physical memory that is available.

Each user program could take less physical memory, more programs could be run the same time, with a corresponding increase in CPU utilization and throughput.

Real, or physical, memory exists on RAM chips inside the computer. Virtual memory, as its name suggests, doesn’t physically exist on a memory chip. It is an optimization technique and is implemented by the operating system in order to give an application program the impression that it has more memory than actually exists. Virtual memory is implemented by various operating systems such as Windows, Mac OS X, and Linux.

So how does virtual memory work? Let’s say that an operating system needs 120 MB of memory in order to hold all the running programs, but there’s currently only 50 MB of available physical memory stored on the RAM chips. The operating system will then set up 120 MB of virtual memory, and will use a program called the virtual memory manager (VMM) to manage that 120 MB. The VMM will create a file on the hard disk that is 70 MB (120 – 50) in size to account for the extra memory that’s needed. The O.S. will now proceed to address memory as if there were actually 120 MB of real memory stored on the RAM, even though there’s really only 50 MB. So, to the O.S., it now appears as if the full 120 MB actually exists. It is the responsibility of the VMM to deal with the fact that there is only 50 MB of real memory.

answer Aug 7, 2015 by Amit Kumar Pandey
Similar Questions
+1 vote

I have few questions about Cache Memory

In my system "free -h" command gave me below output,

      total        used        free      shared  buff/cache   available
Mem:   7.6G        2.1G        1.5G         46M        4.0G        4.8G
Swap:  1.6G         28M        1.6G

1. Why "Cache Memory" is required inside the main memory?

As far as i know "Cache Memory" is different than the main memory(RAM), It is very costly and it is very faster, Please Correct me if i am wrong.

2. Before 1 hour this cache memory was 3 GB and then it is increased by 1 GB?

Please note that I din't start/run any new processes

3. Till what limit i can start new processes/application?

I mean as per free -h command output,

free memory = 1.5 GB, Cache memory = 4 GB and Swap memory = 1.6 GB

can i start new application up to (1.5 + 1.6) GB or (1.5 + 1.6 + 4) GB`?

4. Can i set/configure this cache memory value?

If yes, then how to?

...