[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ale] What does the "shared" mean in the ouput of free



Joseph A Knapka writes:
 > hirsch at zapmedia.com wrote:
 > > 
 > > When I run the command 'free' I get something like this:
 > > 
 > >              total       used       free     shared    buffers     cached
 > > Mem:        110600     109180       1420          0       8772      27780
 > > -/+ buffers/cache:      72628      37972
 > > Swap:       131504        480     131024
 > > 
 > > What exactly does "shared" mean?  Is that only memory shared between
 > > processes using shared memory, or does it count libraries that are
 > > shared between programs?
 > 
 > I am pretty sure that "shared" counts only SyxV shared memory
 > mappings, not generic sharing of mmapped files.

Okay, that makes sense.

 > > On my laptop I have 128 MB of RAM and I'm swapping like crazy.  I'm
 > > running KDE which is large, but I thought that since almost all my
 > > applications are KDE applications they should share a lot.  Instead I
 > > get almost no "share"d memory.
 > > 
 > > Am I misunderstanding the meaning of share?
 > 
 > I think so. At the very minumum, everything dynamically linked
 > to libc.so (which means pretty much everything - annoyingly,
 > even vital stuff like "mv" and "ls" is dynamically linked on
 > some distributions) will share all the pages they use in that
 > lib.
 > 
 > Just curious, what kernel version are you running? It doesn't
 > look like you should be swapping too much with the numbers
 > you give above; does vmstat show a lot of swap activity?

Sorry, I just cut and pasted out of another machine, not my laptop.
I'm not getting much swap activity from the one I posted (which is
running 2.4.2) but from my laptop which is running 2.4.8, I think.

Thanks.  I feel better for getting that explained.

--Michael

---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
sent to listmaster at ale dot org.