LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Why does top show RAM almost all used up (https://www.linuxquestions.org/questions/linux-general-1/why-does-top-show-ram-almost-all-used-up-116495/)

Apollo77 11-15-2003 07:49 PM

Why does top show RAM almost all used up
 
I have a RH 8.0 box that is an email and a web server. It's a celeron 1.3 Ghz with 512MB of RAM. It works great. No complaints.

After a fresh boot, top shows most of the RAM free. However, a few days later top always shows almost all the RAM as being used (~95-99%). Rarely have I seen any swap space being used. I have never experienced problems that lead me to believe I am low on memory. So, I assume really I have lots of RAM for my purposes.

Can anyone explain this? Is top for some reason showing me incorrect values? If so, how can I see accurate memory useage stats?

Thanks in advance,
Apollo

teval 11-15-2003 08:09 PM

It's most likely correct.
Good that it isn't using swap. Swap is a lot slower then RAM.
RAM sometimes is allocated, and the OS doesn't bother overwriting it, but when a program needs it, it gets to use it.
My computer's RAM is... 90% full usually, and I don't remember the last time swap was used, even during really instensive or large operations.

dalek 11-15-2003 08:15 PM

Linux uses memory to cache data that is accessed frequently. Mine does the exact same thing with Mandrake and Gentoo.

Example, the first time I open Mozilla after booting, it takes about 12 seconds. The times after that, about 5 seconds. The program is in memory the second time.

Linux is about being faster. Memory is faster than accessing the drive. If you have 1GB of memory it would do the same thing.

If you use KDE, look here. Start thingy then Configuration then Control Center, the KDE one not the Mandrake Control Center.

Then click Information to expand then Memory. It will show what is in use and how.

Hope that helps a bit. Post back if you need more

Later

:D :D :D :D

Apollo77 11-15-2003 10:09 PM

Ok, I think I get it.

Dalek, when I try your suggestion I see for Physical Memory:

42% cached ram
14% buffer mem
41% used + shared

Am I right in understanding that I'm actually only using 41%, but the 42% and/or 14% would become available if/when needed?

Any similar command like top to see the same thing? I use KDE on my server box sometimes, but usually access it remotely by SSH.

Very helpful. Thank you.
Apollo

Apollo77 11-15-2003 10:19 PM

It appears my understanding was correct .... I started up a whole pile of TightVNC sessions just to chew up RAM, then I killed them all and now there's a pile of RAM free.

So, if some process has previously been loaded into RAM and is now sitting idle as cached RAM, then it can be re-used without being re-loaded, thus allowing a faster startup for that process. Correct?

Thanks!
Apollo

dalek 11-15-2003 10:29 PM

If you were to open up enough apps to need all the memory in your machine, there would be none or very little used for cache. It would even start using swap at that point.

I've been up for a little over a day, been working on Gentoo some, and this is what mine shows with 512MBs installed:

Apps Data 38%
Disk Buffers 13%
Disk Cache 43%
Free 4%

That is what mine usually runs even after being up for weeks. I have currently open: Mozilla, Kmail, Kppp, the memory screen, Gkrellm, a root term, Kscd and Kwrite. Not to mention all the daemons in the background.

I was considering increasing my memory to 1GB until I saw what the memory was being used for. If I did it would cache that much more and still give about the same usage. As long as the apps data is not above 70 to 80%, I would not worry about. If it starts using swap for Apps Data, then it will really slow you down.

You seem to be OK. 512MBs is a lot for Linux.

Hope that helps.

Later

:D :D :D :D

php 11-16-2003 09:33 AM

[justin@taint~] free -m
total used free shared buffers cached
Mem: 503 257 246 0 115 56
-/+ buffers/cache: 84 418
Swap: 224 67 156


free -m works well for showing free memory.. seems to be more accurate than top

mark_booze 12-30-2003 05:48 AM

I am a newbie and have been searching for info regarding memory useage. I run dual boot W2K/Mandrake 9.1 on a PIII 700Mhz with 128MB of SDRAM. Under Uncle Bill's finest OS it appears that on initial load-up and subsequent app opening and closing, the disk does not seem to be hit too hard. However, under Mandrake (always using KDS) it appears slower and more "disk intensive". Having read this thread, am I right in thinking that apllication memory useage of 60% (which is what I see under the KDE SYstem Guard) is typical? Incidentally, upon a fresh start-up I have 59 processes running (also from Systyem Guard)

Many thanks to those who answer

Mark

Apollo77 12-30-2003 08:56 AM

Sounds typical to me. I run KDE under RH 8.0 with 512MB of RAM, but I wouldn't be concerned or surprised if I saw 128MB or more physical RAM being used. You might be hitting swap quite a bit. I noticed a large increase in performance when I upgraded from 128 to 256MB. Upgrading to 512MB made no noticeable difference for me. You would probably be happier with at least 256MB of RAM. Wintendo will run better too.

I hate to say it, but I notice a lag when I open apps in KDE while Wintendo apps seem to open instantly. I have compared on a dual boot box. Not sure why that is, but I wish I knew because in every other way KDE is way better.

Apollo

slightcrazed 12-30-2003 02:31 PM

Windoze pre-loads many DLLs and resources first, meaning that when you start certain apps (usually IE and any of the Office programs) half of the thing is already loaded, hence faster load times. The problem with this is that Windoze doens't like to let go of this RAM. I have a WinXP box at work that I have 9 different apps open on, and 512 MB of RAM. Those 9 apps are not that memory intensive, yet according to mem I have used up almost all of my physical memory and I have about 200MB sitting on SWAP.

slight

mark_booze 12-30-2003 03:48 PM

Thanks team. I concur with Apollo on the speed of loading. I also agree with my preference for KDE over Bill's desktop: much more easily configureable.

I just have to find out why Grip will only rip, not encode

http://www.linuxquestions.org/questi...226#post671226

then I can suspend the use of my W2K box while I do rigorous testing. (better dtart saving for 128MB of SODIMM)

Thanks again


All times are GMT -5. The time now is 12:49 PM.