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

Is "swap" partition is necessary

Go to solution
Super Advisor

Is "swap" partition is necessary


Swap is used as virtual memory.

Swap memory used when our system needs more memory over physical memory if we are running bigger programs.

so If i am running smaller programs swap will not be used.

so is "swap" partition is needed?

pls explain me.
Pete Randall
Outstanding Contributor

Re: Is "swap" partition is necessary

I'm not sure how I can explain it any more simply than ABSOLUTELY!


Bill Hassell
Honored Contributor

Re: Is "swap" partition is necessary

Pete is correct. The swap area is needed because it is part of the total memory map. Also, any programs that use memory mapped files will require some space in the swap area. Your system will be unbootable if there is no swap area. The size really depends on the space you are actually using. Swap space is reserved as processes run, so if you reduce the swap space to a very small value, processes will run out of virtual memory.

Bill Hassell, sysadmin
T G Manikandan
Honored Contributor

Re: Is "swap" partition is necessary

The system reserves swap space when a process is created, but does not allocate swap until its needed. This help the system running out of swap space.

So it is neccessary to have swap allocated on the system.
T G Manikandan
Honored Contributor

Re: Is "swap" partition is necessary

you can have a better understanding when you read the white paper for memory management
Steven E. Protter
Exalted Contributor

Re: Is "swap" partition is necessary


Yes you need swap.

HP-UX requires swap to be present at a minimum of 50% of ram. I once had a customer that cut swap using the command line after install.

Then they called and asked why the system was unstable.

Even with a ton of memory each process reserves swap at start time, in case it might need to swap.

If there is no swap to reserve, the process will fail with an out of memory error.

There is no way around this.

Steven E Protter
Owner of ISN Corporation
Ganesan R
Honored Contributor

Re: Is "swap" partition is necessary

Hi Senthilkumar,

Read this to know "what is swap space"
Best wishes,

Ganesan R
Honored Contributor

Re: Is "swap" partition is necessary

Hi again,

There is a question arise..

"Why purchase a lot of swap space if the system is not expected to page
or swap?"

Here comes "psedue swap" concept.

Pseudo swap is HP's solution for large memory customers who do not wish to
purchase a large amount of swap space.

Pseudo swap is swap space which the operating systems recognizes, but in
reality it does not exist. Pseudo swap is make-believe swap space. It does not
exist in memory, it does not exist on disk, it does not exist anywhere.
However, the operating system does recognize it, which means more swap space
can be reserved than physically exists.

The purpose of pseudo swap is to allow more processes to run in memory, than
could be supported by the swap device(s). Swap devices refer to both device
swap or filesystem swap. It allows the operating system(specifically the kernel
variable swap_avail) to recognize more swap space, thereby allowing additional
processes to start when all of the physical swap has been reserved. By having
the operating system recognize more swap space than physically exists, large
memory customers can now operate without having to purchase large amounts of
swap space which they will most likely never use.

The size of pseudo swap is dependent on the amount of memory in the system.
Specifically, the size is 75% of physical memory

Pseudo swap is enabled through the tunable kernel parameter called swapmem_on.
If the value for swapmem_on is 1, then psuedo swap is turned on or enabled
Best wishes,