Operating System - HP-UX
1822035 Members
3568 Online
109639 Solutions
New Discussion юеВ

Re: Diff between RAM, real memory, virtual memory and swap space

 
Mark FCH_1
Occasional Contributor

Diff between RAM, real memory, virtual memory and swap space

Hi,

I hope this is not too elementary. I run SAM => performance monitor => system properties => memory and the output is shown below.

Physical Memory: 768.7 MB
Real Memory:
Active: 38937.5 KB
Total: 85990.6 KB
Virtual Memory:
Active 278456.7 KB
Total: 323585.0 KB
Free Memory Pages: 89103 at 4KB/page
Swap Space:
Avail: 1024 MB
Used: 508 MB

I always thought that real mem = physical RAM and virtual mem = swap space. If I'm correct, then why are these figures different?

Also under vmstat, what is the meaning of avm and free memory in relation to the SAM output?

Lastly, what does the last line (memory) of the swapinfo command represent?

#swapinfo
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 1048576 0 1048576 0% 0 - 1 /dev/vg00/lvol2
reserve - 510968 -510968
memory 604852 199040 405812 33%

The man pages/unix manuals merely give the technical definition of the terms, which are not of much help to my understanding.

Any help is appreciated. Thanks.

7 REPLIES 7
twang
Honored Contributor

Re: Diff between RAM, real memory, virtual memory and swap space

You may take a look at this paper.
twang
Honored Contributor

Re: Diff between RAM, real memory, virtual memory and swap space

sorry, no point please!
Karthik S S
Honored Contributor

Re: Diff between RAM, real memory, virtual memory and swap space

http://www.argray.org/unixfaq/explain_vm.shtml#vmm

-Karthik S S
For a list of all the ways technology has failed to improve the quality of life, please press three. - Alice Kahn
Mark FCH_1
Occasional Contributor

Re: Diff between RAM, real memory, virtual memory and swap space

Tks for the info.

Your attachment says that virtual mem = physical RAM + all swap space. But the sam output above shows virtual mem as 323mb, physical RAM as 767mb and swap space as 1gb. How is this so?

Also what is the meaning of real memory?

Karthik S S
Honored Contributor

Re: Diff between RAM, real memory, virtual memory and swap space

The following link nice explains various memories in Unix,

http://dataexpedition.com/~sbnoble/Tips/memory.html

Main - The physical Random Access Memory located on the CPU motherboard that most people think of when they talk about RAM. Also called Real Memory. This does not include processor caches, video memory, or other peripheral memory.

Also have a look at,

http://www.introcomp.co.uk/hpux/memory_management.html

-Karthik S S
For a list of all the ways technology has failed to improve the quality of life, please press three. - Alice Kahn
Mark FCH_1
Occasional Contributor

Re: Diff between RAM, real memory, virtual memory and swap space

Point noted. So real Mem = physical RAM and virtual Mem = RAM + swap. Ok, then why does SAM show:

Physical Memory: 768.7 MB
Real Memory:
Active: 38937.5 KB
Total: 85990.6 KB
Virtual Memory:
Active 278456.7 KB
Total: 323585.0 KB
Free Memory Pages: 89103 at 4KB/page
Swap Space:
Avail: 1024 MB
Used: 508 MB

Unless I'm interpreting it wrongly, it shows different values for RAM & real Mem. Also virtual Mem is less then RAM or swap here.

This is what is confusing me right now.
Bill Hassell
Honored Contributor

Re: Diff between RAM, real memory, virtual memory and swap space

Memory mapping and usage is extremely complex since there are so many shared and private uses for memory. Virtual memory (for HP-UX) means the combination of RAM and swap space. However, swap space defines the virtual memory area (regardless of RAM) if the kernel parameter swapmem_on=0. This is leftover from earlier version of HP-UX when memory was measured in megs and swapping was an expected behavior. Today, where typical RAM is several thousand megs, swapmem_on=1 is typical (and the default) so that virtual memory (the space that all processs can use) is defined as 75% * RAM + swap-space. Essentially, swap space is added to 75% of RAM and processes can occupy that entire space.

Swapping is not often a good thing however. If competing processes need to run and they won't all fit in RAM, then swapping takes place with a tremendous performance penalty. To see the entire virtual memory area, always use:

swapinfo -tm

so you can see megs and total. The total line is all of virtual memory (swap and RAM as defined by swapmem_on). With RAM so cheap and performance a very high requirement, trying to figure out what will fit is more of an academic curiosity rather than a sysadmin job. For instance, the buffer cache, the kernel, shared libraries, shared memory and memory mapped files occupy space in RAM but are not assigned directly to specific processes.


Bill Hassell, sysadmin