Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Increasing RAM, do I need to increase swap partition? 2

Status
Not open for further replies.

dalchri

Programmer
Apr 19, 2002
608
0
0
US
I understand it is good practice to have a swap partition twice the size of your RAM capacity.

I will be increasing the RAM in one of our servers from 256MB to 768MB. Am I required to increase the swap partition from 512MB to 1.5GB?

If I am not required, are there any consequences from not doing so?
 
There is not actually a requirement to do so but it is usually considered wise.
You could get away with swap space that is relatively small, indeed I have run systems with no swap at all but then you are more dependant on your ram size.
Swap is used to swap chunks of memory (used by running processes) between ram and hard disk to free that memory off for other processes. In an ideal world you'd never use or need swap at all so I guess it depends really on whether you are going to use enough memory (many or large processes) to need to swap much if at all.


Trojan.
 
What sort of failure occurs with insufficient RAM+swap space?

Are "hungry" processes locked until sufficient resources are freed?

Do existing processes begin to fail or terminate to make way for the hungry process?

Thank you for your input!
 
You know, I've seen windoze lock solid swapping like mad but I don't think I've ever seen Linux or any Unix do it so I'm not sure of the answer.
I wonder if anyone else has every hammered a Unix or Linux machine so hard that it's run out of ram and swap?


Trojan.
 
I guess at the least I can't expect to make anything worse.
 
Hungry processes have to lock themselve, when not enough memory is available.
If they don't they die with 'out of memory'.
Existing processes will not release memory for others - they don't know other processes need memory.

If existing processes need additional memory, they will fail the same way like existing ones.
If they are well doing with constant memory, they will not be affected, as long as the system has enough memory to keep going, and they might slow down drastically, if the system is continously swapping.

seeking a job as java-programmer in Berlin:
 
Absolutely it is possible to cause Linux to hang when it consumes all of RAM and swap (if there is some app that is still trying to get more RAM). You typically see kernel messages that say something about out of memory, killing processes. The screwed up thing about it is that it never seems to kill the process that's being super greedy, just the other running processes. It's not a problem that ulimit seems to fix either, because ulimit creates other problems by killing processes out of order (and creating lots of zombie processes), at least in our application. You might get better results from it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top