I have been battling a problem with a newly installed web server which I have had online for about two weeks now.
I started with a Redhat 7 box running MySQL and Apache complete with 256mb of RAM. After about a day the system would freeze completely. I never got a message as why it was crashing until the final one when I saw the screen said something to the effect there was not enough SWAP. Hmmm, it was working fine and showed plenty of memory when I booted it up.
So I installed another 256mb of RAM and let it run. Throughout the day I watched the memory drop from 400mb available to 10mb available. Then it started eating into the swap:
--------------------------------------------------------------------------
From top:
Mem: 516072K av, 499196K used, 16876K free, 39208K shrd, 225204K buff
Swap: 160608K av, 704K used, 159904K free 207812K cached
-------------------------------------------------------------------------
Like a virus the swap is being utilized more and more. 20 minutes ago it was using 500k, now it is 704k.
What is going on here? Is this what is known as a memory leak? How do I find out where the leak is?
I have heard from some that Linux will utilize RAM not being used and release it as needed. If this is true why is it using the swap. I always thought swap was for emergencies when resources are low. With 512mb of ram and at a quiet time of the day should it even be dipping into the swap?
|