System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

swap question: memory 100% versus device 50% (and op.sys. NOT FORKING)

SOLVED
Go to solution
llagos
Occasional Advisor

swap question: memory 100% versus device 50% (and op.sys. NOT FORKING)

Hi All...

I've got the following situation with swap space.

My system has 2 swap areas. The memory (I understand it's the real RAM installed) and 1 device with enough space. Problem is that the memory goes to 100% and the op.sys. stops forking. No more commands, no more logins.

BUT... the device is NOT 100%... See below... memory went 100% but the device is 58% and STILL has unused space..

So, question here: why is this?

And how to fix this? I mean by fixing, telling the op.sys. to use that device space, and of course, keep forking and swaping new processes...

ttemip01::/tmp-> swapinfo
Kb Kb Kb PCT START/ Kb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 6291456 3627984 2663472 58% 0 - 1 /dev/vg00/lvol2
reserve - 2663472 -2663472
memory 2076144 2072732 3412 100%
ttemip01::/tmp->

Thanks a lot for your help...

Leo
9 REPLIES
James R. Ferguson
Acclaimed Contributor

Re: swap question: memory 100% versus device 50% (and op.sys. NOT FORKING)

Hi Leo:

Swap space is required to be reserved at the time a process starts up. You have insufficient swapspace and/or memory.

You can add additional device swap but you should look toward adding memory and/or adjusting your workload. You say that you have two swap areas but I see only the primary swapspace reported. Verify that any secondary device swap has been activated in your '/etc/fstab' if you believe that it should be.

Regards!

...JRF...
llagos
Occasional Advisor

Re: swap question: memory 100% versus device 50% (and op.sys. NOT FORKING)

Thanks James...

I'm new to HP-UX so, maybe a few newbie questions...

for instance:

ttemip01::/-> dmesg | grep -i physic
physical page size = 4096 bytes, logical page size = 4096 bytes
Physical: 2076144 Kbytes, lockable: 1245664 Kbytes, available: 1465620 Kbytes
ttemip01::/->

This means I have 2 Giga of physical RAM...


Now...

ttemip01::/-> swapinfo
Kb Kb Kb PCT START/ Kb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 6291456 2931016 3360440 47% 0 - 1 /dev/vg00/lvol2
reserve - 3323452 -3323452
memory 2076144 1330728 745416 64%
ttemip01::/->


The "memory" line means 64% of those 2G are used. What is the "reserve"..??? Avail=0 so, Free is actually a negative number...

Now, when "memory" goes to 100%, why does it stop forking processes, if it still has 40% available in the "device"?? That's my real question...

Regards,

Leo
Michael Steele_2
Honored Contributor

Re: swap question: memory 100% versus device 50% (and op.sys. NOT FORKING)

Hi:

Here's a link about the same problem. I hope it helps you.

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1215537

From Dennis Handly in this link:

"...You could also be in a recursive fork loop where it just eats all of your swap space..."
Support Fatherhood - Stop Family Law
Venkatesh BL
Honored Contributor
Solution

Re: swap question: memory 100% versus device 50% (and op.sys. NOT FORKING)

> Now, when "memory" goes to 100%, why does it stop forking processes, if it still has 40% available in the "device"?? That's my real question...

The fundamental principle is - when a process starts to run, the kernel will 'reserve' swap space for all its private space (private data) to ensure that it does not fail later due to lack of swap space. This is just a counter decrementing thing.

Now, when the reservation on the device is no more possible, it will start using RAM as a place for the new swap reservation requests. This means that the pages that are bought in now, will not be paged out. There physical and swap space and one and the same.

In your case, 58% of device space is 'used' means that actually so much of pages from the RAM were moved to that device through the 'page out' process.

You getting 'no swap' error in this case simply means that the remaining 42% of the device swap is 'reserved' for the running processes, to accomodate their future needs.

You need to add another swap device to overcome this problem.
V. Nyga
Honored Contributor

Re: swap question: memory 100% versus device 50% (and op.sys. NOT FORKING)

Well, actually I think you need more RAM.

Swapping is slowing down your system, so you should avoid it!

You also can test:
'vmstat -n'
swapping is unter po - it should be as small as possible, >99 is VERY bad.

HTH
Volkmar
*** Say 'Thanks' with Kudos ***
Sajjad Sahir
Honored Contributor

Re: swap question: memory 100% versus device 50% (and op.sys. NOT FORKING)

Dear Leo

To fully utilize all of the RAM on a system there must be a sufficient amount
of virtual memory to accomodate all processes . The virtual memory be at least eaqual to physical memory plus application
size.
For a process
to spawn it needs a sufficient amount of virtual memory to be placed in
reserve. There should be a sufficient amount of free device swap to open any
processes that may be spawned during the course of operations. By subtracting
thereserve from the device total you can determine this value.
If there is an insufficient amount available ( typically from device swap)
you will receive an error : cannot fork : not enough virtual memory. If
this error is received , you will need to allocate more device swap. This
should be configured on a disk with no other swap partitions, and ideally of
the same size and priority of existing swap logical volumes to enable
interleaving.

thanks and regards

Sajjad Sahir
llagos
Occasional Advisor

Re: swap question: memory 100% versus device 50% (and op.sys. NOT FORKING)

Thanks everybody for your shared knowledge.

Very much clear now...

Regards,

Leo
llagos
Occasional Advisor

Re: swap question: memory 100% versus device 50% (and op.sys. NOT FORKING)

Thanks everybody...
Dennis Handly
Acclaimed Contributor

Re: swap question: memory 100% versus device 50% (and op.sys. NOT FORKING)

It would be more helpful for you to provide "swapinfo -tam" output. It gives a nice total and in Mb, that is easier to understand.