Operating System - HP-UX
1834462 Members
3024 Online
110067 Solutions
New Discussion

Some questions about Memory and Swap

 
Wang,MinJie
Super Advisor

Some questions about Memory and Swap

Hi all
I've got two questions.

Question 1:
Please check out the following output:
********************************************
Mb Mb Mb
Avail Used Free
memory 2037 617 1420
********************************************
It's one entry of the output by running "swapinfo"
And I know it's information about Pseudo Swap
Now I want to know why 617Mb of Pseudo Swap is used and what's it for?The manual said it's used for other purposes but didn't mention what it is.

Question 2
Run "top" and I got the following information
*********************************************
Memory:22000000K real,28000000K virtual,28680000K free
*********************************************
Can you explain real,virtual and free memory in detail?

Any help will be appreciated
10 REPLIES 10
Dennis Handly
Acclaimed Contributor

Re: Some questions about Memory and Swap

>Now I want to know why 617Mb of Pseudo Swap

1) The simplest way to deal with swapinfo is to always use "swapinfo -tam" and only look at the total line.

2) Real is the actual RAM. Virtual probably includes swap space.

top(1) says:
Includes virtual and real memory in use (with the amount of memory considered "active" in parentheses) and the amount of free memory.
G V R Shankar
Valued Contributor

Re: Some questions about Memory and Swap

swapinfo -t will give you the swap configured in the system. If you have many swaps configured, you will see all the list.

#swapinfo -t
Kb Kb Kb PCT START/ Kb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 4096000 0 4096000 0% 0 - 1 /dev/vg00/lvol2
dev 4096000 0 4096000 0% 0 - 0 /dev/vg00/lvswap2
reserve - 448608 -448608
memory 54199400 5960192 48239208 11%
total 62391400 6408800 55982600 10% - 0 -

Here I have 2 logical volumes configured for swap.

Use /usr/sbin/cstm to find the exact Memory installed in the system.

/usr/sbin/cstm (Press Enter Key)
cstm>map (Press Enter Key)
cstm>sel dev 341 (Press Enter Key) (In my system Memory Dev Number is 341, that is why I have used 341)

cstm>info (Press Enter Key)
cstm>il (Press Enter Key)

You will see the installed memory on the system

cstm>exit (Press Enter Key)

# kmtune -q swapmem_on
Parameter Current Dyn Planned Module Version
===============================================================================
swapmem_on 1 - 1

If it is set to 1, that implies 75% of your physical memory is designated as psuedo swap.

Hope this info is helpfull.

Cheers,
Ravi.
Wang,MinJie
Super Advisor

Re: Some questions about Memory and Swap

Hi all
Thank you for replying
May be you haven't caught my question
As we all know
Pseudo Swap is just a virtual number to "cheat" on kernel,So I think it couldn't be used
but according to the output of "swapinfo"
617MB of Pseudo Swap is used
Now I want to know what's it used for?
G V R Shankar
Valued Contributor

Re: Some questions about Memory and Swap

Could you please tell how much of physicall memory configured on the system. Is swapmem_on is set to 1?

If 617 MB psuedoswap is being used, what is primary swap utilization. If it is zero, that clearly implies that the pseudoswap is used instead of primary swap.

If you are looking for what is psuedoswap and how it works, let me know.

Cheers,
Ravi.
Wang,MinJie
Super Advisor

Re: Some questions about Memory and Swap

Hey GVR
here is the total information by running "swapinfo -m"
**************************************
Mb Mb Mb
TYPE AVAIL USED FREE
dev 2048 0 2048
reserve - 237 -237
memory 2037 557 1480
**************************************
Now I've got 557MB Pseudo Swap in used.
And there is no primary swap in used(swapmem_on=1 by the way)
So how does it work?
Dennis Handly
Acclaimed Contributor

Re: Some questions about Memory and Swap

It would be helpful if you provided "swapinfo -tam".

>So how does it work?

Since you are using less VM than the amount of RAM that you have, there is no need to use device swap.
G V R Shankar
Valued Contributor

Re: Some questions about Memory and Swap

Since the Virtual Memory usage is very less, RAM is using psuedoswap to hold the data instead of pri device swap. (swapmem_on is equalt to one, as I said earlier, if this param is 1, 75% of RAM will be treated as swap).

When you have psuedoswap configured, system uses deactivation method instead of page outs/Ins to primary swap device. When a page fault occurs, it reactivates the pages in psuedoswap, which is nothing but the RAM itself.

If number of memory pages are more, then it uses primary swap to hold the data.

Cheers,

Ravi.
Yogeeraj_1
Honored Contributor

Re: Some questions about Memory and Swap

hi,

glance -m

the above command can also clarify your current environment and memory usages.

e.g at the end of the report, the following will be displayed:

Total VM : 1.03gb Sys Mem : 1.08gb User Mem: 328.0mb Phys Mem: 8.00gb
Active VM: 910.9mb Buf Cache: 819.2mb Free Mem: 5.80gb



hop this helps too!

kind regards
yogeeraj

No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Don Morris_1
Honored Contributor

Re: Some questions about Memory and Swap

1) Some memory allocations always use pseudo-swap if present [because it would be silly not to]. These are allocations which are "locked" in memory (i.e. are not allowed to be paged until explicitly unlocked) -- via the mlock()/plock() interfaces... or because they are Kernel allocations [which are almost always non-pageable]. So that 617Mb is quite likely very near your kernel memory load which has stolen that amount of pseudo-swap. (It won't be exact because the amount of pseudo-swap is a percentage of RAM, the kernel can get all the non-Ejectable RAM [11.31 only concept], early boot kernel memory is accounted differently when it is consumed before the accounting layer is initialized, etc.)

2) Real: User actual physical consumption (in Kb)
Virtual: User virtual address space consumption (in Kb)
Free: User allocatable physical memory (in Kb) at this time.

Note the "User" in all of the above -- top is NOT (and should never be used as) a system-wide reporting mechanism.... it only knows about User processes and User resources.

I'm really not sure what further detail you'd want beyond the above.. if you haven't read the VM White Paper for the basic concepts, you should:
http://docs.hp.com/en/1218/mem_mgt.html
Wang,MinJie
Super Advisor

Re: Some questions about Memory and Swap

Thank you all
But I haven't make it clear.
So I'll start a new thread