LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   memory usage question (https://www.linuxquestions.org/questions/linux-hardware-18/memory-usage-question-129293/)

bmicielli 12-27-2003 01:01 PM

memory usage question
 
Hi Everyone,

I'm running REDHAT 9.2 with kernel version 2.4.20-27.9 its running on a desktop pc PIII / 1GHZ. I'm running everythin that came with 9.2 and have an active web server and mysql. Getting about 2k hits per day. My desktop came with 128 meg of memory and I noticed it was slow. I have a 256meg swap file and was using 201 megs of it. I decided to upgrade memory to 384 meg. What I have noticed is that I start with 100 free megs of memory when I reboot but throughout the day that number decreases until I run out of physical memory and start to use the sway file. By the end of a 24 hour cycle I end up using 40 meg of swap space. I noticed that almost every application now uses more memory than before. Is this normal behavior for linux....are there any things I should look for.

timdsmith 12-27-2003 02:17 PM

The way Linux sees it, if the memory is not being used, it's going to waste. The way I understand it, and anybody please feel free to correct me if I'm wrong...Is that most of the memory usage you show is actually cached data. It can be dumped at any time if another program needs that memory. I run Slackware and have 512 MB of RAM and it's not uncommon at all for my system monitor to show only 25 to 30 MB free.
But if I run $free
from the command line, I get
tim@localhost:~$ free
total used free
Mem: 515496 510048 5448
-/+ buffers/cache: 231012 284484

Now, if I understand it right, the top line under used is how much is used cache and all. The second line is what is actually in use. The second line under free is the amount that is actually available in case another program needs that memory.
I couldn't tell you what the numbers are after a fresh boot because it's been almost a month since I rebooted.

damn, i can't get the numbers to line up right...but you should be able to sort it out.

twilli227 12-27-2003 06:46 PM

Like timdsmith said, linux will use the memory that you have. Is anything running slow or slower? If not, then you should be good. If something is running slower than normal type"top" in a terminal window to show you what processes are runing, how much cpu usage, and memory usage.

Crito 12-27-2003 07:15 PM

Took me a while to get used to it. Windows tries to maximize available physical mem at all times, swapping out idle background process even when there's plenty free. In stark contrast, Linux takes the opposite approach, minimizing swapfile use at all times and resizing the data cache dynamically to compensate. Net effect seems to be Linux runs background processes more smoothly but Windows loads new processes faster.


All times are GMT -5. The time now is 10:30 PM.