Operating System - HP-UX
1753869 Members
7143 Online
108809 Solutions
New Discussion юеВ

Re: Deferred swap reservation failure

 
SOLVED
Go to solution
Mustafa Gulercan
Respected Contributor

Deferred swap reservation failure

i have a Hp-ux 11.11 system with oracle ias running.phy.mem is 8 GB and swap area is 4 GB

today i get "Deferred swap reservation failure" error from dmesg.
here is my swapinfo from glance;

Swap Device Type Avail Used Pri
/dev/vg00/lvol2 device 4.0gb 1.5gb 1
pseudo-swap memory 6.1gb 5.1gb -1


#swapinfo -tam
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 4096 1489 2607 36% 0 - 1 /dev/vg00/lvol2
reserve - 2607 -2607
memory 6288 5241 1047 83%
total 10384 9337 1047 90% - 0 -

Now my questions are;
1- From galance memory uti. is %77. why OS use swap %90?
2-Why OS first use pseudo rather than lvol2?
There is 2,5 GB free are on lvol2.
3-What should i do?add a second swap area?

regards;
Mustafa
3 REPLIES 3
Don Morris_1
Honored Contributor
Solution

Re: Deferred swap reservation failure

1) Because swap != memory and memory != swap. Don't conflate the two, you'll only make bad assumptions.

Quick core concept note: HP-UX (unlike some other Unices) requires virtual objects to reserve the equivalent amount of swap at the time of creation. As a result, if you malloc 4Gb, the OS knows it will have 4Gb of swap space to move that to in the event it needs to push RAM in that object out. So it is important to note that swap reservation consumption reflects your total virtual memory cost on the system (it is possible/easy to consume 100% of swap reservation by simply malloc'ing very large objects... hence the max*siz{_64bit} tunables, shmmax, etc.)

The sole exception to this is that some APIs allow the object creator to defer swap reservation until actual RAM is consumed, with the understanding that if swap is not available, the RAM creation can be failed. [Lazy swap]. This is what happened in your dmesg case.

The total in swapinfo reflects the swap resources consumed as Used+Reserved. As you can see from your output, all your lvol2 swap which is not already used (contains actual paged-out data) is already reserved, and 83% of the pseudo-swap memory (RAM pages allowed to swap to themselves) is also Used/Reserved [pseudo-swap really doesn't have a distinction between the two]. Hence the 90% swap consumption total.

From your error, I would imagine you have spikes that drive you above 90% as well.

2) See above. lvol2 was used first -- it has been entirely reserved. Not all of lvol2 has active swap pages, but no resources are left on it. The OS then proceeded to start reserving from pseudo-swap, and you get to where you are.

3) Or look into your virtual address load (top, ps, Glance, etc.) If you have an application which is excessively large for no reason (say a developer running a small tool that has 8Gb of DATA and they can't give you a good justification for that) you should investigate memory leaks in that application. Alternately, you could lower the max*siz{_64bit} tunables to prevent applications from growing too large for your system.

Assuming you application load is what you desire, and no leaks, etc.. adding additional swap or RAM (for pseudo-swap_ is the way to go.
IT Operations Unix Admi
Occasional Advisor

Re: Deferred swap reservation failure


HP-UX definition of memory and swap are a bit different from Linux or other unices. In short swapinfo -tam shows a total line with a PCT USED. If that number becomes 100% processes can not get memory anymore. This also means it is not possible to start new processes or to fork a process. To prevent this you can add more swap space or more memory.

Your swapinfo -tam output shows that the swap space is really used. Look with a "vmstat 10 10" and "sar -w" if you see numbers above 100 for pi, po consider buying more memory. Other wise just add another swap partition.

Hint, if you create the swap partition on the same disk give it priority 2 to prevent interleaving of the swap over 2 partitions which gives an additional performance decrease.

Paul
Rita C Workman
Honored Contributor

Re: Deferred swap reservation failure

You have some very detailed explanations on swap and memory.

To keep it brief you should add some disk swap. Keep it the same size as the original disk swap.

3. Create yourself an lvol lvswap1 at 4GB, and lvswap2 at 4Gb of disk
Make sure you turn it on and set it to enable the additional swap on reboot via SAM.
NOTE:
Make sure you use disk that is NOT in use by anything else...and keep it that way.
I use spare disk off my disk array for additional swap.

Rgrds,
Rita