Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Nasty memory usage
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Martin
Tux's lil' helper
Tux's lil' helper


Joined: 12 Jun 2002
Posts: 96
Location: Vancouver, Canada

PostPosted: Sat Jul 06, 2002 8:28 am    Post subject: Nasty memory usage Reply with quote

This has been bugging me for a while - I'm getting some nasty memory usage and can't figure out where it's being eaten up. top reports:

512 av, 453 used, 60 free. 0 swap

8O

Some quick addition of proceses adds up to only 170 used. What gives? Is this normal? Does linux just allocate all the memory like that?

(Please explain to this ex MS whore)

Thanks. :wink:
Back to top
View user's profile Send private message
ElCondor
Guru
Guru


Joined: 10 Apr 2002
Posts: 520
Location: Vienna, Austria, Europe

PostPosted: Sat Jul 06, 2002 8:41 am    Post subject: Reply with quote

linux uses all the memory available, if there are no programs loaded ("used memory") it will be filled up with "buffers" and "cache" where "buffers" is like the usual disk cache and "cache" is keeping program code in the memory of programs you have run before.

depending on the kernel, it may also start to swap while there is still free memory! this has been changed by linus at about 2.4.10 and was heavily discussed (and flamed ;) ). the idea is, that a programm starts to swap out it's code when cpu/disk are idle, and when it comes to the point that another program really needs more memory than currently available, the first loaded program just frees the ram and uses it's already swaped data, which can speed things up quite a lot .. but it's terrible on notebooks with enough memory.

PS: does anyone know whether the gentoo-kernels are using the -ac patches to refrain from swapping?

* ElCondor pasa *
_________________
Here I am the victim of my own choices and I'm just starting!
Back to top
View user's profile Send private message
trythil
Tux's lil' helper
Tux's lil' helper


Joined: 06 Jun 2002
Posts: 123
Location: RHIT, Terre Haute, IN, USA

PostPosted: Sat Jul 06, 2002 9:23 am    Post subject: Reply with quote

You may want to try using free instead of top...top does a notoriously bad job at reporting memory quantities, mostly because it's too stupid to accurately represent things. In particular, multithreaded programs will make top go nuts (and you as well, if you don't know how to read the output).

Here's an example:

Code:

trythil@beleriand trythil $ free
             total       used       free     shared    buffers     cached
Mem:        126660      96520      30140          0          0      68284
-/+ buffers/cache:      28236      98424
Swap:       329324      23748     305576


In that above figure, I've got 28.2 MB of physical RAM used, and 98.4 MB free. It's not 96.5 MB used and 30.1 MB free -- a lot of that is taken up by buffers and caching, which are automatically flushed/replaced by the kernel.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum