You are not logged in.

#1 2008-01-26 00:53:14

rdking
Member
From: Halifax NS
Registered: 2005-04-14
Posts: 114

figuring out mem usage

OK, just doing some comparisons and reading about memory usage.  It seems weird to me that with XFCE running, pidgin, epiphany and rhythmbox, top says:

[ryan@Archbox ~]$ top 

top - 20:49:11 up  9:26,  1 user,  load average: 0.02, 0.11, 0.09
Tasks:  86 total,   1 running,  85 sleeping,   0 stopped,   0 zombie
Cpu(s):  6.0%us,  1.3%sy,  0.0%ni, 92.7%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   1035376k total,  1015100k used,    20276k free,    67032k buffers
Swap:  2273188k total,        0k used,  2273188k free,   678840k cached

but the processes themselves take up no reall memory....what is the cached?  Why is it so big?

free - m gives:

[ryan@Archbox ~]$ free -m
             total       used       free     shared    buffers     cached
Mem:          1011        991         19          0         65        663
-/+ buffers/cache:        262        748
Swap:         2219          0       2219

I guess I am just wondering why my machine's memory 1Gig is almost completely used.  I mean, I am trying to run XFCE, and windowmaker and blackbox, to save a memory footprint.....

as memory serves this isn't too far off what a standard gnome or kde base would eat.

Offline

#2 2008-01-26 01:23:35

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: figuring out mem usage

The cache is used for frequently accessed or cross referenced data, and data that's going to be really "expensive" performance wise to reread. While it is physical memory being used, Linux will drop it if it needs space requested by the user. You really only need to be concerned about the non-cached memory.

Offline

#3 2008-01-26 08:23:40

dmartins
Member
Registered: 2006-09-23
Posts: 360

Re: figuring out mem usage

As skottish said, cached memory is memory which can be released quickly if need be. The second row under the 'used' column listed by the free command is a pretty good indication of how much memory is actually in use.

Consider this (and this may not be a completely accurate example but I hope it gives you an idea of what is happening): You open firefox. It takes 100 MB of RAM. You finish with firefox and close it. The 100MB it was using now becomes available to other applications. But why remove it from memory until something else needs the space? Why not leave it in memory, but mark it as cached?

If you remove it from memory then try to reopen firefox, it would have to be read from the hard drive again, which is many times slower than RAM. If it is left in RAM and you open an application which requires more RAM than what is free, the data for firefox can be overwritten with no extra delay.

On the other hand, if you open firefox again, it's data is alreay in RAM so it should open much faster to open than the first time when it was read from the hard drive.

I hope this makes sense, my brain is a little muddy right now cool

Offline

#4 2008-01-27 16:03:21

ssl6
Member
From: Ottawa, ON, CA
Registered: 2007-08-30
Posts: 594

Re: figuring out mem usage

ok, so if i understand this right. if i have 2gb of ram, no swap partition. when i boot my system, i have about 400-500mb in use, if i let it sit idle overnight and look at it in the morning, i have 15mb ram free. but 1.3gb of it is cached from what im looking at. so that means, that stuff can be dumped quickly when i need to open something else? i guess that explains why i haven't really noticed any issues


this is a signature

Offline

Board footer

Powered by FluxBB