System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Is there any difference between virtual memory and swap memory

SOLVED
Go to solution
senthil_kumar_1
Super Advisor

Is there any difference between virtual memory and swap memory

Hi All,

I would like to know whether there is any difference between virtual memory and swap memory.
4 REPLIES
P Arumugavel
Respected Contributor
Solution

Re: Is there any difference between virtual memory and swap memory

HP-UX use Virtual Memory to load processes into memory. In simple terms, Virtual Memory consists of two parts, physical memory
or ram and swap. The physical memory is where the programs are running, and
swap is the "spill over". Swap devices are usually parts of a physical hard
drive. Swap allows the total number of processes to exceed the amount of
physical ram, and can be allocated as needed.

Swap refers to a physical memory management strategy (predating UNIX) where entire processes are moved between main memory and secondary storage. Modern virtual memory systems today no longer swap entire processes, but rather use a paging scheme, where individual pages of data and instructions can be paged in from secondary storage as needed, or paged out again to free up memory for other uses. This is backed up by a deactivation scheme that allows whole processes to be pushed out if
the system is desperately short of memory. However, the secondary storage dedicated to storing paged out data is still referred to as "swap space".

In practice, there's no difference or anything that should affect your development due to the subtleties of paging vs. swapping. Unless you have sufficient privilege to ensure part or all of your working set can't be paged, the process can be deactivated/swapped if the system decides it has to do so, the process simply isn't run for a while from its point of view.

rgds...
muruganantham raju
Valued Contributor

Re: Is there any difference between virtual memory and swap memory

Hi Senthil,
As the earlier thread briefs, there is no difference. Conceptually Virtual memory is an addressing scheme and Swap is being used by operating systems to provide virtual memory.
HTH
Muru
Kranti Mahmud
Honored Contributor

Re: Is there any difference between virtual memory and swap memory

Hi Senthil,

Swap slices are used as virtual memory storage areas when the system does not have enough physical memory to handle current processes.

The virtual memory system maps physical copies of files on disk to virtual addresses in memory. Physical memory pages which contain the data for these mappings can be backed by regular files in the file system, or by swap space. If the memory is backed by swap space it is referred to as anonymous memory because there is no identity assigned to the disk space backing the memory.

rgds-Kranti
Dont look BACK as U will miss something INFRONT!
Kranti Mahmud
Honored Contributor