1835894 Members
3438 Online
110086 Solutions
New Discussion

Re: SWAP

 
SOLVED
Go to solution
Habib_4
Advisor

SWAP

Hi guys,

What is swap and what is it used for?

Also, are there any recommended sizes that swap should be configured to be?

Cheers!

Habib
5 REPLIES 5
Tiziano Contorno _
Valued Contributor

Re: SWAP

Searching in this same forum:

http://docs.hp.com/en/B2355-90672/ch06s02.html

It's the first admin bibble :)
Peter Godron
Honored Contributor
Solution

Re: SWAP

Habib,
swap is an area of the disk you set aside to act as virtual memeory. So if the machine needs more memory than is installed, it uses the additional area for processing. Problem with swap is that disk is a lot slower than RAM. Recommendations used to be to allocate twice the size of RAM as swap.
DCE
Honored Contributor

Re: SWAP

Swap is uesed to page idle porcesses out of memory to disk.

HP-UX seems to require as a minimum one for one memory to swap - i.e. 1 GB memory - 1 GB swap. As memory gets used, the system reserves the swap space, but does not actually use it. So if you do not have enough swap space allocated, there is a chance you will not be able to use all of the available memory

For systems with 2 GB or less memory, the going recommendation seems to two to one i.e. 2GB swap to 1GB memory.

It should be noted that if you actually start using swap your system performance will severely degrade (the systems must swap the processes from disk back to memory)Memory is cheap - add more to the system.

For systems over 2 GB you should use psuedoswap in the kernel (swapmem_on=1). This activates psuedoswap, which allows you to fool the system into thinking there is more swap than there actually is. You still need to assign physical swap, but not as much, say .5 to 1.

HTH
Dave

Andrew Rutter
Honored Contributor

Re: SWAP

habib,

swap is as peter says, and a default install will create primary swap twice the physical memory upto 2gb.
example if you have 512mb ram installed then you would have 1gb swap created.

It is also used for a memory dump incase of system crash, which is why its recommended to have more than physical memory. you can also have secondary swap on another disk if required.


This can be increased as needed and some databases need alot more swap than simple apps. It depends upon the usage really.

Andy
dipesh_2
Regular Advisor

Re: SWAP

Hi Habib

Swap space is an area on a high-speed storage device,reserved for use by the virutual memory system for paging activities.

Several kernel tunable parameters limit the amount of swap that can be made available.
The default maximum swap space you can configure, for both device and file system swap is combined, approx. 512MB. The tunable parameter maxswapchunks, control this maximum. The size of swapchunk can be modified with the swchunk kernel tunable parameter.