1825782 Members
2127 Online
109687 Solutions
New Discussion

Re: Pseudo-swap

 
Guillou_2
Frequent Advisor

Pseudo-swap

Hi,

I have a system with 4go of memory, swap size is equal to memory size and pseudo-swap is enable.

Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 4096 0 4096 0% 0 - 1 /dev/vg00/lvol2
reserve - 1545 -1545
memory 3058 908 2150 30%
total 7154 2453 4701 34% - 0 -

If my process consume all my memory so all my disk swap is reserved/allocated, how pseudo-swap works in this case?

Thanks in advance for your help

Regards
4 REPLIES 4
V. Nyga
Honored Contributor

Re: Pseudo-swap

sreekanthtm
Trusted Contributor

Re: Pseudo-swap

Hi,

>>If my process consume all my memory so all my disk swap is reserved/allocated

No, All your swap area is not yet reserved, because pseudoswap is enabled.

>> If you have got 1 GB of swap and 4 GB of available memory. Can you start a 2 GB process?

Yes, With Pseudoswap Enabled
Swap1 GB Device (+) Swap3 GB Pseudo Swap (75% of 4GB)= 4 GB ReservableSwap.

No, With Pseudoswap Disabled.
1 GB Device + Swap0 GB Pseudo Swap = 1 GB ReservableSwap

Rgds
Sreekanth
Guillou_2
Frequent Advisor

Re: Pseudo-swap

Thanks for your help, but I didn't understand very well how pseudo-swap works when swap device is exhausted.
If pseudo-swap is active, when a new process is forked with free memory low and swap device fully reserved, what the system does to allow its creation?
Ganesan R
Honored Contributor

Re: Pseudo-swap

Hi,

Consider this...

You have 100GB of memory in high end server. Theoritically you need minimum 100GB of swap space. If the running applications never need swap then it is going to be waste of space.

With the help of pseudo-swap you can logically consider 75% of memory as swap along with device swap. This way you can save the disk space.

>>If pseudo-swap is active, when a new process is forked with free memory low and swap device fully reserved, what the system does to allow its creation?<<<

It will allow. Here kernel is going to handle this situation. From application point of view enough swap space is available. But kernel will do the manipulation by moving the data from device swap.
I agree new process will not be started if no swap spce to reserve. But the situation will not arise as long as we will be having total swap space is more than physical memory.

Total swap = Device swap + 75% of memory.
Best wishes,

Ganesh.