LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-15-2003, 07:49 PM   #1
Apollo77
Member
 
Registered: Feb 2003
Location: Toronto
Distribution: RH8 / FC1 / Gentoo / Debian / FreeBSD / Centos / Ubuntu
Posts: 182

Rep: Reputation: 35
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
 
Old 11-15-2003, 08:09 PM   #2
teval
Member
 
Registered: Jul 2003
Location: Toronto, Canada
Distribution: Gentoo
Posts: 720

Rep: Reputation: 30
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.
 
Old 11-15-2003, 08:15 PM   #3
dalek
Senior Member
 
Registered: Jul 2003
Location: Mississippi USA
Distribution: Gentoo
Posts: 2,058
Blog Entries: 2

Rep: Reputation: 79
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

 
Old 11-15-2003, 10:09 PM   #4
Apollo77
Member
 
Registered: Feb 2003
Location: Toronto
Distribution: RH8 / FC1 / Gentoo / Debian / FreeBSD / Centos / Ubuntu
Posts: 182

Original Poster
Rep: Reputation: 35
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
 
Old 11-15-2003, 10:19 PM   #5
Apollo77
Member
 
Registered: Feb 2003
Location: Toronto
Distribution: RH8 / FC1 / Gentoo / Debian / FreeBSD / Centos / Ubuntu
Posts: 182

Original Poster
Rep: Reputation: 35
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
 
Old 11-15-2003, 10:29 PM   #6
dalek
Senior Member
 
Registered: Jul 2003
Location: Mississippi USA
Distribution: Gentoo
Posts: 2,058
Blog Entries: 2

Rep: Reputation: 79
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

 
Old 11-16-2003, 09:33 AM   #7
php
Member
 
Registered: Jun 2001
Location: USA
Distribution: Slackware
Posts: 827

Rep: Reputation: 30
[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
 
Old 12-30-2003, 05:48 AM   #8
mark_booze
LQ Newbie
 
Registered: Dec 2003
Posts: 19

Rep: Reputation: 0
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
 
Old 12-30-2003, 08:56 AM   #9
Apollo77
Member
 
Registered: Feb 2003
Location: Toronto
Distribution: RH8 / FC1 / Gentoo / Debian / FreeBSD / Centos / Ubuntu
Posts: 182

Original Poster
Rep: Reputation: 35
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
 
Old 12-30-2003, 02:31 PM   #10
slightcrazed
Member
 
Registered: May 2003
Location: Lisbon Falls, Maine
Distribution: RH 8.0, 9.0, FC2 - 4, Slack 9.0 - 10.2, Knoppix 3.4 - 4.0, LFS,
Posts: 789

Rep: Reputation: 30
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
 
Old 12-30-2003, 03:48 PM   #11
mark_booze
LQ Newbie
 
Registered: Dec 2003
Posts: 19

Rep: Reputation: 0
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
RAM: Does linux require as much ram as Windows XP? hanzj Linux - Newbie 48 04-18-2007 12:14 AM
Win98SE Pentium166MMX/64MB RAM vs Linux AthlonXP+ 3000/512MB RAM : Lucent LT WinModem t3gah Linux - Software 2 04-22-2005 01:01 PM
top don't show me all my ram Polyvore Linux - General 2 04-29-2004 02:00 AM
How can I use "top" to show all of the processes preswang Linux - General 10 10-16-2003 02:32 AM
top and RAM bickford Linux - General 9 03-26-2001 03:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration