General
cancel
Showing results for 
Search instead for 
Did you mean: 

Memory choking out on HP-UX 10.20

SOLVED
Go to solution
Mike Rightmire
Frequent Advisor

Memory choking out on HP-UX 10.20

Hey Gang,

I am running an HP-UX 10.20 server in a production environment. It maintains a series of user objects, each one taking up a chunk of memory.

Every once in a while, when the number of objects get high, the memory will get used up and the machine will be unable to start any new processes of any kind.

When I do a swapinfo, I get the following ...

TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 1996 0 1996 0% 0 - 1 /dev/vg00/lvol2
reserve - 1996 -1996
memory 2887 2887 0 100%

When it gets to 100%, I cannot even do a remote login. My question is this, the swapinfo shows the memory swap as all used up, a device swap with 1996MB available, all 1996MB reserved, but none of it used.

Is the device swap being used, and if not where is the configuration error. I would have assumed that I should be able to run an almost unlimited number of objects and, if they got too high, they would simply start swapping to the hard drive more and slow the machine down, NOT take up all the available mem and choke the machine out...?

Thanks for any help you might give!
Mike
"If we treated each person we met as if they were carrying an unspeakable burden, we might almost treat each other as we should." Dale Carnegie
8 REPLIES
Rita C Workman
Honored Contributor

Re: Memory choking out on HP-UX 10.20

What are your dbc_max_pct/dbc_min_pct parms set at?

The default for these is 50max/5min. But if you leave it at 50 for max than it's going to 50% of memory and put it as reserved off the top....I generally recommend setting this at 10max (..on certain conditions I have gone to 15) and 5min.

Just a thought,
/rcw
Andy Monks
Honored Contributor
Solution

Re: Memory choking out on HP-UX 10.20

Mike,

Do a swapinfo -t (or -tm) and only look at the bottom line.

When a process start (and while it's running), if it asks for memory, the system allocates the same amount of swap space for it too should it need to be paged out. Therefore, although it may not be using the swap space, it's all be allocated (as swapinfo -tm) will show).

You can either increase swap space by using device swap, or if it's rare this occurs (and it's not actually using it), create some filesystem swap.
Mike Rightmire
Frequent Advisor

Re: Memory choking out on HP-UX 10.20

Andy,

Thanks for the input. I did the swapinfo -tm as you recommended, but it still leaves me confused. I think I do not understand the HP usage of device swap.

When I did the command, it did indeed show as AVAIL 2887MB of mem swap, and 1996MB of dev swap for a total of 4883. Under the USED heading it showed the dev swap as "0" used, the reserved as 1996MB and the mem used as 2460. Under the FREE heading it showed the dev swap as 1996 free, the reserve as -1996 and the mem as 427.

I understand the decive swap has 1996MB of space for swap, and it reserves ALL of it for the swap file (so that nothing else can be put there) but is the device swap (the reserved space) actually being used? And, if it is, why is the system choking out completely when the memory area gets full, instead of just slowing dramatically down because it is swapping more?

I have been searching the manuals for a description of the swap and how HP-UX uses it. If any of you know of a good tutorial, I would love to read it.

Thanks again!
Mike
"If we treated each person we met as if they were carrying an unspeakable burden, we might almost treat each other as we should." Dale Carnegie
Andy Monks
Honored Contributor

Re: Memory choking out on HP-UX 10.20

Mike,

There is a good explaniation of 'psuedo swap' which is what this is in the file

/usr/share/doc/mem_mgm.txt

Althought the device swap isn't used, it's all be reserved and therefore you can't create more processes.

at hp-ux 11 (using elf executables), you can change this behaviour).
James A. Donovan
Honored Contributor

Re: Memory choking out on HP-UX 10.20

The HP-UX 10.20 swap model requires that a process be able to reserve swap space. If all swap is already reserved, then no more processes can be spawned until another process dies.
Remember, wherever you go, there you are...
Dan Vowell
Occasional Advisor

Re: Memory choking out on HP-UX 10.20

Also, check the setting of the kernel parameter 'swapmem_on' (1=enabled, 0=disabled).

This turns on/off 'pseudoswap' (allows remaining RAM to serve as an electronic disk)!

If the output from 'swapinfo' shows sufficient device swap (1.5-2 times physical memory, or higher - depending on application requirements), you should be able to disable it and reclaim some memory for use by system/user processes.

Also, ensure that filesystem buffer cache isn't penalizing your system's virtual memory management capabilties (too small or too large can have a major impact on how the system behaves).
"Your mileage may vary"
Bill Hassell
Honored Contributor

Re: Memory choking out on HP-UX 10.20

As mentioned, the default behavior of HP-UX is to require all processes in RAM to map 1:1 (reserve) space in swap. So with 1996 megs of RAM and 1996 megs of swap, you're out of virtual memory. Swaps space is NOT additive unless you enable pseudo swap. This allows up to 75% of RAM to be utilized WITHOUT a corresponding reservation in the swap area, thus increasing the virtual memory area by 75% of RAM.

Just change the kernel parameter swapmem_on to a 1 and now swapinfo -tm will make more sense, plus you'll be able to run more processes. Note that once you start using swap space, things will slow down.


Bill Hassell, sysadmin
Magdi KAMAL
Respected Contributor

Re: Memory choking out on HP-UX 10.20

Hi Mike,

You must increase your swap space.
When you start new processes they ask to RESERVE memory and when it's available the system allocates it for them.

There is a rule for attributing swap space for system running production applications:

swap space = 3 or 4 times the amount of memory.