Operating System - HP-UX
1830207 Members
2079 Online
109999 Solutions
New Discussion

Virtual Memory and Swap Space

 
SOLVED
Go to solution
Ong Chin Soon
Occasional Contributor

Virtual Memory and Swap Space

What's the difference between virtual memory and swap space ?
chin soon
4 REPLIES 4
U.SivaKumar_2
Honored Contributor
Solution

Re: Virtual Memory and Swap Space

Hi,
They are same. Virtual memory is not possible without swap space.

regards,
U.SivaKumar
Innovations are made when conventions are broken
T G Manikandan
Honored Contributor

Re: Virtual Memory and Swap Space

Whenever processes lag memory in the Real memory,processes which are idle are swapped or paged to the hard disk.
Later they are taken back to memory on need.

This area of memory which is used on the disk is the virtual memory which is also called as swap space.


Thanks
Animesh Chakraborty
Honored Contributor

Re: Virtual Memory and Swap Space

A good document is here
http://www.usg.edu/OIIT/support/os/HP-UX_10.20/white_memman.html

Did you take a backup?
Wodisch
Honored Contributor

Re: Virtual Memory and Swap Space

Hi,

they are not quite the same: take an Xclient like "dtterm" for example.
It uses some megabytes of virtual memory, but only a small part of it on real RAM, and maybe nothing really on swapspace! Most of its program code may never be used at all and is therefor never paged into RAM. It does account for virtual memory, though. And some of the pages used in RAM may not be needed any more and hence become "freed" from RAM without problem.
If you use the command "size" on a codefile, it will tell you the amount of virtual memory needed on its start, but as the programs data can grow, so will its virtual memory.
If the reason for your question is to learn about the size of your swap space, then the answer is quite simple:
Set the kernel parameter "swapmemon" to 1, then you'll only need swap space for 1/4 of your RAM!
I.e. 1GB of RAM, and 256MB of swap space would be fine.

HTH,
Wodisch