Operating System - HP-UX
1827283 Members
3440 Online
109717 Solutions
New Discussion

confused on swap & virtual memory

 
SOLVED
Go to solution
f. halili
Trusted Contributor

confused on swap & virtual memory

What's the difference between swap & virtual memory?

When I do a "swapinfo -at", I can still see the "total PCT USED" to be around 74% but when I do a "vmstat 1 1", the "memory free" column is so low ( memory free * 4 ) / 1024?

Thanks,
f. halili




derekh
4 REPLIES 4
Basheer_2
Trusted Contributor
Solution

Re: confused on swap & virtual memory

Halili,

What is Swap: KBRC00015720.

If you do not have support, see the attached text.
Hope it helps
Basheer
RAC_1
Honored Contributor

Re: confused on swap & virtual memory

swap - swap space that you configured. (note that if you have set kernel tunable "pseudo_swap to 1", then swapinfo will also add one as memeory)
virtual meme - swap space configured + physical RAM on the system.

The free mem count that you get in vmstat is free "virtual memory" It is in pages. (1 page is 4096k) So you need to "free_page * 4096" to get the value in bytes.

Anil
There is no substitute to HARDWORK
Robert Bennett_3
Respected Contributor

Re: confused on swap & virtual memory

Here's a real good paper that explains many things as well as swap and virtual memory in an easy to understand, yet technical, style. It has been a great guide for me.

http://h21007.www2.hp.com/dspp/files/unprotected/devresource/Docs/TechPapers/UXPerfCookBook.pdf

Here's a small excerpt:

Memory Setup
Hey, memory is cheap so buy lots (a hardware vendor's point of view). Application
providers will usually supply some guidelines for you to use for how much memory
you'll need, though in practice it can be tough to predict memory utilization. You do not want to get into a memory bottleneck situation, so you want enough memory to hold the
resident memory sets for all the applications you'll be running, plus the memory needed
for the kernel, plus dynamic system memory such as the filesystem buffer cache.
If you're going to be hosting a database, or something else that benefits from a large inmemory
cache, then its even more essential to have enough memory. Oracle installations,
for example, can benefit from "huge" SGA configurations (gigabyte range) for buffer
pools and shared table caches.
Resident memory and virtual memory can be tricky. Operating systems pretend to the
applications that there is more memory on your system than there really is. This is called
Virtual Memory, and is essentially the amount of memory allocated by programs for all
their data, including shared memory, heap space, program text, shared libraries, and
memory-mapped files. The total amount of virtual memory allocated to all processes on
your system roughly translates to the amount of swap space that is reserved (with the
exception of program text). Virtual memory actually has little to do with how much
actual physical memory is allocated because not all data mapped into virtual memory will
be active ("Resident") in physical memory. Confused yet? Hey, memory is cheap so buy
lots.

"All there is to thinking is seeing something noticeable which makes you see something you weren't noticing which makes you see something that isn't even visible." - Norman Maclean
f. halili
Trusted Contributor

Re: confused on swap & virtual memory

thanks!!!
derekh