Operating System - HP-UX
1748092 Members
5573 Online
108758 Solutions
New Discussion юеВ

Re: RAM is only used at 40% but swap is already kick in

 
SOLVED
Go to solution
jasonK_1
Frequent Advisor

RAM is only used at 40% but swap is already kick in

TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 10240 5 10235 0% 0 - 1 /dev/vg00/lvol2
reserve - 8335 -8335
memory 7790 3136 4654 40%
total 18030 11476 6554 64% - 0 -

My question is why the memory usage is only at 40% and yet the swap is already used for 5MB? Something wrong here? What is your recommendation?
8 REPLIES 8
Dennis Handly
Acclaimed Contributor

Re: RAM is only used at 40% but swap is already kick in

>why the memory usage is only at 40% and yet the swap is already used for 5MB?

(I assume that was really 5 Gb.)
Swap is reserved but not allocated. Nothing is wrong.
Dennis Handly
Acclaimed Contributor

Re: RAM is only used at 40% but swap is already kick in

>ME: (I assume that was really 5 Gb.)

Oops, I guess it was really 5 Mb. This must be the type of pages that needed to be allocated and/or was swapped out at one time.

It is the 8 Gb that I mentioned that is reserved.
Don Morris_1
Honored Contributor
Solution

Re: RAM is only used at 40% but swap is already kick in

A few possibilities:

1) You had a spike in physical memory usage earlier which isn't happening now. The system will free swap when/if a previously paged object is removed - but it doesn't bother doing it if the memory is paged back in, especially if it is unmodified [as it saves a repeat I/O if a paging opportunity reoccurs]. Hence a spike in memory load can result in swap being used even with lots of free memory post-spike when you run the tools to observe things.

2) The system is actually under physical memory pressure now. This can happen if the memory load is primarily in User space and is yet another reminder that pseudo [memory] swap is *not* RAM and you shouldn't try to conflate the swapinfo output to RAM consumption. Consider -- you have 8Gb or so of disk swap reserved. You probably have around 8Gb or so of physical memory [I don't know your OS version, so I don't know the rough percentage your memory line represents relative to RAM... just go with the example 8Gb]. Say your SYS RAM load is 512Mb, leaving 7.5Gb for user space. If that 8Gb of user space virtual faults all of it in (or at least say a 7.5Gb SGA shared memory object), you will consume all of physical memory. swapinfo will still show the same reserve, and the memory line will only reflect the locked memory of the SYS usage. But paging will occur - because you're trying to use all of RAM. Typically, you shouldn't expect to run out of swap before you run out of RAM, after all.

3) You aren't under global system pressure but could be using PRM/WLM/gWLM/whatnot which has limited a workload to a smaller amount of memory -- resulting in just that workload being under memory pressure and needing to page.

What does vmstat say? Are there page outs? What version of the OS? Do you have Glance -- and if so, what does it report for physical memory usage?
jasonK_1
Frequent Advisor

Re: RAM is only used at 40% but swap is already kick in

To Don:

OS version:
HP-UX dbCus B.11.31 U 9000/800 2221170520 unlimited-user license

VMSTAT:
procs memory page faults cpu
r b w avm free re at pi po fr de sr in sy cs us sy id
2 1 0 706095 59875 0 0 1 0 0 0 0 1051 6820 654 1 2 97

GLANCE MEM REPORT:
Event Current Cumulative Current Rate Cum Rate High Rate
--------------------------------------------------------------------------------
Page Faults 3378 14488 767.7 376.3 842.5
Page In 880 3343 200.0 86.8 200.0
Page Out 0 0 0.0 0.0 0.0
KB Paged In 0kb 52kb 0.0 1.3 45.7
KB Paged Out 0kb 0kb 0.0 0.0 0.0
Reactivations 0 0 0.0 0.0 0.0
Deactivations 0 0 0.0 0.0 0.0
KB Deactivated 0kb 0kb 0.0 0.0 0.0
VM Reads 0 12 0.0 0.3 1.8
VM Writes 0 0 0.0 0.0 0.0
Total VM : 4.8gb Sys Mem : 16.0tb User Mem: 18.4gb Phys Mem : 8.0gb
Active VM: 1.1gb Buf Cache: 4mb Free Mem: 229mb FileCache: 3.0gb


jasonK_1
Frequent Advisor

Re: RAM is only used at 40% but swap is already kick in

Can someone tell me why the system mem in the glanceplus report is 16 terrabyte? Please see the picture attachment.
Dennis Handly
Acclaimed Contributor

Re: RAM is only used at 40% but swap is already kick in

>system mem in the glanceplus report is 16 terrabyte?

Santa Claus came early this year and only told gpm? ;-)
Don Morris_1
Honored Contributor

Re: RAM is only used at 40% but swap is already kick in

Could be QXCR1001008926, fixed in 11.31.1103 via PHKL_41005 at first glance (no pun intended).
Don Morris_1
Honored Contributor

Re: RAM is only used at 40% but swap is already kick in

Sorry - looks like PHKL_41005 is 11.31.1009 - not sure why the QXCR was marked as 1103 instead. Ah... maybe because an unrelated change (this is a fairly large patch set with a lot of changes) resulted in a Warning -- looks like you should apply PHKL_41355 or later [PHKL_41972 is the latest, and that should be what's in 1103].