Operating System - HP-UX
1834626 Members
2905 Online
110069 Solutions
New Discussion

top/vmstat/swapinfo Outputs And Memory

 
SOLVED
Go to solution
Wei Ning
New Member

top/vmstat/swapinfo Outputs And Memory

Dear All

I tried to determine the free memory level on my hp-ux server, but found it difficult to correlate the outputs from top/vmstat/swapinfo. For instance:

top output:
Memory: 2267668K (1099308K) real, 6125204K (3950564K) virtual, 34108K free

vmstat output:
memory: 987641 avm, 9125 free

swapinfo output:
memory: 2769444 Kb Avail, 916800 Kb Used, 1852644 Kb Free

The free memory outputs from top and vmstat are close, but very different from swapinfo output.

If there is 1.8GB memory free for pseudo-swap, wouldn't this amount of memory be considered as free memory?

How to interpret these outputs correctly? How much real memory is free on this server?

Thank you very much, and,
Happy New Year!
7 REPLIES 7
Peter Godron
Honored Contributor

Re: top/vmstat/swapinfo Outputs And Memory

Hi,
and welcome to the forums.

Stefan's answer from:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=227661

"The memory line from swapinfo DOES NOT SHOW MEMORY USAGE. It shows how much of memory is locked by processes ineligble for swap.

To accurately see how much free memory you have use glance/gpm, or vmstat. The free line from vmstat shows pages free, multiply it by 4096 to get size in bytes.

The main point to swapinfo is to show device swap usage - in your case set to 1024MB, and 230MB used - which means at some point you have completely run out of memory. swapinfo doesnt update accurately, so all it means is at one point you had 230MB of memory swapped to disk (which cripples performance). Use vmstat or glance/gpm to check the current memory and swap usage."


Please also read:
http://forums1.itrc.hp.com/service/forums/helptips.do?#33 on how to reward any useful answers given to your questions.
Steve Steel
Honored Contributor

Re: top/vmstat/swapinfo Outputs And Memory

Hi

ftp://hprc.external.hp.com/memory.htm

Is great


You can request the tools via local HP


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Wei Ning
New Member

Re: top/vmstat/swapinfo Outputs And Memory

Hi

So vmstat result is accurate. But I'm still a bit confused with memory "Kb FREE" value in swapinfo, since it means "the amount of space that can be used for future paging", why it does not mean free memory? I assume the memory must be free in order for it to be used for future paging?

And the link ftp://hprc.external.hp.com/memory.htm does not show anything except a security note.

Thank you
Peter Godron
Honored Contributor

Re: top/vmstat/swapinfo Outputs And Memory

Hi,
the correct link is:
ftp://eh:spear9@hprc.external.hp.com/memory.htm
Don Morris_1
Honored Contributor
Solution

Re: top/vmstat/swapinfo Outputs And Memory

No, you're making a bad assumption.

HP-UX prefers actual swap reservation to pseudo-swap reservation. So RAM which is in use when there is device swap available will not affect the pseudo-swap line in swapinfo at all.

The exceptions are:

+ Memory consumed by the kernel (implicitly locked since the kernel is not swapped out)

+ Memory which is unpageable due to use of the mlock/plock interfaces. Since this memory can't be paged anyway, it makes sense to reserve it from pseudo-swap instead of real swap [leaving more real swap for memory which can be paged].

Only when device/FS swap reservation space is exhausted should you see non-locked memory start to consume pseudo-swap... so swapinfo tells you pretty much nothing about free memory resources.
Wei Ning
New Member

Re: top/vmstat/swapinfo Outputs And Memory

Thank you all for the help
Emil Velez
Honored Contributor

Re: top/vmstat/swapinfo Outputs And Memory

top should show you the amount of memory free

swapinfo has nothing to do with memory free except to show you how much swap space is in use.

vmstat shows you the humber of pages free so multiply the number of free pages by 4K (depending on your page size)

Remember that if you are swapping vhand will move unused pages out to a swap device to free memory so your memory will go down but then go up as vhand starts doing its work.

Also reember that part of your memory (DBC min and DBC max) means that some of your memory is used for buffer cache as a buffer for i/o of filesystems. The proper tuning of this parameter can make more memory available if you need more.

Good luck

Emil