Operating System - HP-UX
1833064 Members
2905 Online
110049 Solutions
New Discussion

Swap less than physical RAM

 
SOLVED
Go to solution
GoHP
Advisor

Swap less than physical RAM

Please let me know what could happen when swap space is less than the physical memory.

Swap = 4GB
Ram = 6GB

Thanks
7 REPLIES 7
Christine Hartman
Valued Contributor

Re: Swap less than physical RAM

the dump file will be incomplete...it will only write out what it can.
James R. Ferguson
Acclaimed Contributor

Re: Swap less than physical RAM

Hi:

If you don't have "pseudo swap" enabled with the kernel parameter 'swapmem_on' then you will not be able to utilize all of your physical memory. Swap space must be reserved at process startup.

If you enable pseudo swap, then 75% of your physical memory is counted for the purposes of swap reservation. This allows more processes to start with less swap space.

Pseudo swap is ideal for large memory configurations and costs almost nothing in terms of performance. You avoid wasting disk creating device or filesystem swap space.

If you do 'swapinfo -tam' and see a line labeled "memory" then you have pseudo swap enabled.

Regards!

...JRF...
Patrick Wallek
Honored Contributor
Solution

Re: Swap less than physical RAM

It depends.

1) If you have swapmem_on=1, then the system will use approximately 4.5GB (75% of 6GB) as "pseudo-swap" (no it does not actually consume RAM, it's just a calculation), and add that to your 4GB swap so you have 8.5GB of swap space available. This will allow you to use your entire 6GB of RAM since each process that starts MUST reseve some swap space.

2) If you have swapmem_on=0, then you just have 4GB of swap space. This would only allow you to start 4GB of processes, rendering 2GB of your 6GB of RAM useless. Again, this is because EACH process that HP-UX starts MUST reserve swap space.

To see if you have swapmem_on turned on (set to 1) do a 'swapinfo -tam'. If you see a "memory" line, then swapmem_on=1. If you don't see a "memory" line then swapmem_on=0.
GoHP
Advisor

Re: Swap less than physical RAM

Wow ... Thanks for quick reply.
What's the advatage to set swapmem_on=0 ?
This parameter in the kernel must be a reason.

Sanjay_6
Honored Contributor

Re: Swap less than physical RAM

Hi,

Mayube this link would help.

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

The itrc doc id is KBRC00015724.

Hope this helps.

regds
Thummalu
Frequent Advisor

Re: Swap less than physical RAM

Hi Munch,

Its better to have swapmem_on=1 always.

It is not advantageous in your condition. your 2GB of RAM is not used in allocation for processes. change your kernel paramter such that swapmem_on should be

swapmem_on 1 - 1

br
Thummalu
Ted Buis
Honored Contributor

Re: Swap less than physical RAM

Psuedoswap help reduce the amount of device swap needed by locking pages in memory so that they can't be swapped. This effective increases the virtual address space without using more device swap. The problem is that if you ever do need to page out, then the 25% of memory that isn't locked, gets unfairly hammered causing erratic response. Pages are locked into pseudoswap arbitarily, so it isn't a fair approach. Thus, if you are going to do substantial page outs, you are much better off, allocating more device swap and turning off psuedoswap. Naturally, the best approach is to leave it on and by enough RAM so that you never have a high page out rate.
Mom 6