Operating System - HP-UX
1848602 Members
6992 Online
104033 Solutions
New Discussion

Swapinfo and Paging on HPUX 11.11

 
SOLVED
Go to solution
Girish Agarwal_1
Occasional Advisor

Swapinfo and Paging on HPUX 11.11

Hi All,
I am not sure whether I am interpreting correctly or is it definately a problem.
When I give swapinfo -mat on my machine, here is the output
Device Name MB Used Free %Used
dev 2048 68 1980 3%
reserve - 1081 -1081
memory 729 319 410 44%
total 2777 1468 1309 53%

My first Question is Why it is using dev memory when the physical memory is still only 44% used.
My second Question is Why the memory is 729MB instead of 1GB or atleast as per dmesg output
Physical: 1048576 Kbytes, lockable: 746048 Kbytes, available: 864560 Kbytes

it should be 864MB.

I am attaching the lotsfree paramtere , dbc_max_pct parameter and dbc_min_pct parameter values which were suggested in some earlier forums:-

kmtune -q dbc_max_pct
Parameter Current Dyn Planned Module Version
===============================================================================
dbc_max_pct 15 - 15

kmtune -q dbc_min_pct
Parameter Current Dyn Planned Module Version
==============================================================================
dbc_min_pct 5 - 5

kmtune -q lotsfree
Parameter Current Dyn Planned Module Version
===============================================================================
lotsfree - - 0

10 REPLIES 10
Sanjay_6
Honored Contributor

Re: Swapinfo and Paging on HPUX 11.11

Hi,

Try this link from itrc,

http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000066374044

The itrc doc id is KBAN00000661.

Hope this helps.

Regds
Girish Agarwal_1
Occasional Advisor

Re: Swapinfo and Paging on HPUX 11.11

Hi Sanjay,
Clearly the article shows that I have pseudo swap enabled.
It says that the Totak KB column should be 75% of physical memory which in my case should be 1048576 * 75% = 786432 . but is shows 729MB .
Also, it effectively says that dev usage will be greater then 0% if and only if the memory column says that all the memory has been used.
Then my Question again is why this is not the case in my machine. Are there any misconfigured kernel parameters.
Kindly suggest

Thanks,
Girish
Don Morris_1
Honored Contributor

Re: Swapinfo and Paging on HPUX 11.11

pseudo-swap is not 75% of raw physical memory -- it is 75% of available physical memory after the kernel starts up. So you lose a little bit from kernel usage and the buffer
cache pages.

Regarding why you've actually paged, the amount of memory being used as pseudo-swap doesn't directly correllate to the RAM in use -- so what's your actual physical usage? (You have 1.5Gb or so in reservations... if those pages are actually touched, you can easily trigger paging).

Alternately, this may be the calm after the storm (running a high network load a few minutes back?) where there _was_ memory pressure which has died down and those pages just haven't been brought back in.

In summary -- there isn't enough data with just swapinfo's output to know why you've paged. I'd look at Glance to see where the physical memory is in use.
Emilio Brusa
Frequent Advisor

Re: Swapinfo and Paging on HPUX 11.11

Hi
You have 1gb in your machine, but only 729Mb can used for the user`s process ...its ok the machine was separate your memory.


Girish Agarwal_1
Occasional Advisor

Re: Swapinfo and Paging on HPUX 11.11

Hi Don,
In your reference to 75% of available memory after kernel . Is there any formula or calculation for caclulating available physical memory.
As I have attached the dmesg output it shows that available memory is 864560 KB.
75 % of that is approx 650MB.

Also,
Can you suggest some way as to how I can see whether paging is happening and at what scale. I see in vmstat 2 5 output that "free" column is ~ 4200 and "avm" column is 294789, which leads me to believe that this machine is paging.

Also can you guide me from where can I download glance if it is downloadble.


Thanks,
Girish
Don Morris_1
Honored Contributor
Solution

Re: Swapinfo and Paging on HPUX 11.11

The 75% is of available memory after the kernel has finished most of the allocations (and set aside space for the buffer cache). To come up with a formula, I'd really have to sit down and go through all the tunables and how they affect boot-time allocations (since a lot of them directly influence the sizing of kernel data structures), number of processors, amount of memory (plus bad memory fragmentation, etc).

In other words -- I don't think it's worth it for an exact formula, sorry. The "available" memory at the dmesg output comes a bit later.

The long and the short of it -- 75% of physical memory will be *close* but not exact.

We know that you're paging -- disk is actually used, after all. I'm more curious as to what caused the paging, since that's what you want to address (i.e. have you got a memory leak, do you just need more memory for the workloads the box runs, etc.) Glance comes as part of the Enterprise Operating Environment... I was under the impression that there's a trial version in other OE's -- hopefully someone can correct me if I'm wrong on this.

You can buy it as part of PRM if you don't need the whole Enterprise OE (that seems to be the way to get it from my quick search on software.hp.com -- I don't claim to be speaking for HP or an expert on Glance delivery models here.)

One quick alternative to Glance would be to just run

UNIX95= ps -eo 'vsz sz pid args' |more

and look for processes with large SZ fields (physical usage). [Or use pstat_getprocvm() to pull all the data yourself and analyze it..]
Bill Hassell
Honored Contributor

Re: Swapinfo and Paging on HPUX 11.11

The minor difference between swapinfo and 75% of RAM is due to the actual way it is calculated internally. Memory allocation in HP-UX (like most Unix versions) is very complicated. Memory usage is as simple as kernel plus programs. There is a shared buffer cache that is dynmaic (changes all the time), shared memory which is requested by one program but shared by others, there are I/O buffers, and the list goes on.

Usually when questions are asked about memory usage, the problem is due to a program(s) that are failin with out-of-memory messages, or performance seems sluggish. vmstat has the answer: ignore all the columns except po (page out). Single digits (0-9) are fine and can be ignored. Double digits are OK for short periods of time by high double digits (50-99) indicate memory shortage. 3 digits and higher indicate a massive impact on performance caused by very small RAM. Most database systems need 4Gb as a minimum, 8-16Gb for heavy usage.


Bill Hassell, sysadmin
Ted Buis
Honored Contributor

Re: Swapinfo and Paging on HPUX 11.11

Make sure that you have more disk swap space than RAM, and enough swap chunks in the kernel to cover the swap space, otherwise RAM will not be fully used other than for psuedo swap.
Mom 6
Girish Agarwal_1
Occasional Advisor

Re: Swapinfo and Paging on HPUX 11.11

Hi Bill,

The Question More specifically is when swapinfo is showing 490MB free why it is using Device swap space.

From Don's suggestions I figured out the dbsnmp oracle process definately has a memory leak problem.

So can this be related to any kernel paramter(s) wherein the process can be allocated a maximum of XMB of memory and if it utilises more than that allocated memory then it will start paging????

Thanks,
Girish
Bill Hassell
Honored Contributor

Re: Swapinfo and Paging on HPUX 11.11

Memory are programming errors. Memory is requested but never released when no longer needed. However, this condition (a process slowly growing in size) may be perfectly normal. Kernel parameters like maxdsiz do not 'enable' memory leaks, they simply limit the maximum amount of growth of a program. Most programs with memory leaks will usually crash when they hit the limit. The swap space usage you are seeing is very likely due to memory mapped files which always use some swap by design.


Bill Hassell, sysadmin