LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-28-2004, 12:00 AM   #1
Davus
Member
 
Registered: Jul 2004
Location: Mesquite, Texas
Distribution: currently retired
Posts: 31

Rep: Reputation: 15
High memory usage?


When booting my Linux box, its memory usage was very high within 6 minutes. I have 256MB RAM on the thing, and 3MB or less was fee. It doesn't seem that a single application is using hundreds of MB of RAM so I'm not sure what's going on. Here's a "ps aux;uptime;free" dump:
kidindustries.net/dump.txt
Real-time stats available at kidindustries.net/servstat.php

See anything causing this? o_O Or maybe my RAM stick is messed?

I upgraded the RAM from 128 to 256 because of this problem, and in the time of 128 it had about 2 MB free with 0 swap used, now it's repeating on 256 except using more to fill the 256.

P.S. netstat -a also added to dump, just in case.
P.S.S. I also noticed MySQL using a bit of memory...

Last edited by Davus; 11-28-2004 at 12:04 AM.
 
Old 11-28-2004, 02:29 AM   #2
student04
Member
 
Registered: Jan 2004
Location: Georgia
Distribution: OS X, CentOS
Posts: 669

Rep: Reputation: 34
Linux tends to handle memory different than windows does. Are you using any large window manager, such as KDE or GNOME? Those can take up a large amount of memory easily. Also, linux will tend to fill up the memory, but that doesn't mean that you need more, it is just how system resources are handled. I don't think i can be anymore clear, because i haven't studied this yet; i just know that memory usage isn't something to worry about (especially with 256, which is a small amount these days...). I have 512MB of RAM on my laptop, and only between 0-50MB is free anytime i look. Yet it does not run slowly, it's just a different way of managing your computer's resources. Running servers such as apache, mysql, ftp can increase the amount of memory usage depending on how many outsiders are accessing your server. Are you running anything besides mysql?
 
Old 11-28-2004, 02:30 AM   #3
dalek
Senior Member
 
Registered: Jul 2003
Location: Mississippi USA
Distribution: Gentoo
Posts: 2,058
Blog Entries: 2

Rep: Reputation: 65
That is normal for Linux. I have 1Gb in my machine and it uses almost all of it. This is mine:

Code:
root@smoker / # free
             total       used       free     shared    buffers     cached
Mem:       1034728     847152     187576          0     204064     250720
-/+ buffers/cache:     392368     642360
Swap:       488336          0     488336
root@smoker / #
What you want to watch is the swap. If it starts to using a !lot! of swap then you need more memory. 256Mb should be fine for most applications and just surfing the net.

The way Linux does is this: You open a app then close it. The app stays in memory unless you open another app that needs that memory. It caches the program. Note the "cached" part above in mine. Why, because the memory is faster to access than the hard drive, much faster in fact. Memory is faster than a SCSI drive even. Linux will keep caching data until it needs the memory for something else, or it has filled it up. This is also why Linux can find bad memory so well.

If you see a few megabytes of swap, that is OK. Even mine sometimes uses a little bit and I don't do any video stuff or anything that uses more memory than Mozilla or KDE. Mozilla can be a hog though.

I used to have 512Mbs of memory and upgraded to 1Gb. To be honest, I didn't see much difference. 256Mbs is good, 512Mbs is a bit better, any more than that for just surfing and such is overkill. I don't regret the upgrade but it did not really improve anything.

Hope that helps. This has been asked numerous times. I have even answered the question before.

Later

 
Old 11-28-2004, 02:33 AM   #4
Davus
Member
 
Registered: Jul 2004
Location: Mesquite, Texas
Distribution: currently retired
Posts: 31

Original Poster
Rep: Reputation: 15
By the way, this is a server instead of a client, so KDE/Gnome/Mozilla are out.
I'm running FTP, SSH, SMTP, HTTP, SQL, and IRC.
So basically the server is pushing aside memory but it's still available? Odd memory management ways, would make one unable to know how much memory is actually being used at a time.
 
Old 11-28-2004, 02:55 AM   #5
dalek
Senior Member
 
Registered: Jul 2003
Location: Mississippi USA
Distribution: Gentoo
Posts: 2,058
Blog Entries: 2

Rep: Reputation: 65
Until it starts using a !lot! of swap space, like 100Mbs or so, which is a indication that it is out of memory, it is doing fine. As I said though, it may use a bit of swap from time to time. That is normal. I suspect that if you or I had 3Gbs of memory, it would still eventually use some swap. Just may take longer to get there.

You should be fine though. Memory management in Linux is much better than windoze. You close a app and it makes it available if it is needed. It is rare that I read of memory problems in Linux.

You are right though, it is hard to actually tell how much memory is really being used. You can use top and then hit the "m" key to sort by how much memory is being used. Just type in top and the command line. Hit "q" when you get ready to quit. It also shows memory usage at the top, cache and all. Hit "?" for help with the options.

Later

 
Old 11-28-2004, 03:22 AM   #6
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,158

Rep: Reputation: 328Reputation: 328Reputation: 328Reputation: 328
Look at the line +/- buffers/cache in the free output. That tells how miuch memory is actually available. The files /proc/meminfo has more detail, and /proc/slabinfo shows you what the kernel slab allocator (internal kernel data structures) is allocating is quite nauseating detail. Besides, what's the point of buying RAM if your OS only uses it occasionally? Linux makes sure you get your money's worth on your RAM.
 
Old 11-28-2004, 03:33 AM   #7
dalek
Senior Member
 
Registered: Jul 2003
Location: Mississippi USA
Distribution: Gentoo
Posts: 2,058
Blog Entries: 2

Rep: Reputation: 65
Code:
root@smoker / # cat /proc/meminfo
MemTotal:      1034728 kB
MemFree:        185228 kB
Buffers:        206256 kB
Cached:         255916 kB
SwapCached:          0 kB
Active:         495040 kB
Inactive:       208308 kB
HighTotal:      131008 kB
HighFree:          252 kB
LowTotal:       903720 kB
LowFree:        184976 kB
SwapTotal:      488336 kB
SwapFree:       488336 kB
Dirty:              16 kB
Writeback:           0 kB
Mapped:         270672 kB
Slab:           129392 kB
Committed_AS:   274248 kB
PageTables:       1840 kB
VmallocTotal:   114680 kB
VmallocUsed:     26400 kB
VmallocChunk:    88220 kB
root@smoker / #
So mine would be 1034728000 - 185228000 - 206256000 - 255916000 which equals 387328000. That is what gkrellm shows, well pretty close anyway. My mozilla sucks up some memory. I have the Mozilla cache turned up a bit. Dial-up sucks. Mozilla uses 133Mbs on mine. I have seen it higher.

What is "dirty"? It shows that has 16kb. Just curious.

Oh, for the original poster, you ahve to cat those files. cat /proc/meminfo

Later

 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
High memory usage Kapriel Debian 6 07-29-2005 12:01 PM
High memory usage on Slack 10 lil_drummaboy Slackware 3 11-26-2004 06:47 PM
high memory usage. nexx_au Fedora 2 12-08-2003 04:41 AM
Memory usage too high glock19 Linux - General 7 06-05-2003 08:05 AM
VERY high memory usage.....Normal? bison42 Linux - Newbie 4 08-23-2001 11:57 AM


All times are GMT -5. The time now is 09:44 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration