[SGVLUG] used memory on a 4 GB system.

David Lawyer dave at lafn.org
Thu Nov 2 00:26:17 PST 2006


On Wed, Nov 01, 2006 at 01:48:33PM -0800, Jeff Carlson wrote:
> To really see how much memory is available, use the free command.  In
> all reality, top doesn't do a very good job.  It's for quickly finding
> things, not really in-depth analysis.  Still, you should watch top for a
> few days.  Learn what's normal for your machine.  Add load to it, watch
> changes.  Here's free on my 256MB:
> 
>            total     used     free   shared  buffers   cached
> Mem:      255180   243828    11352        0     2904    65072
> -/+ buffers/cache: 175852    79328
> Swap:    1052248   108816   943432
> 
> Notice the line with -/+ buffers/cache?  You'll see that when I add
> buffers back to free -- which technically, it is -- that I have
> 187,204KB, about 182MB, free.

I don't understand.  Isn't free reporting 79MB free, not 182MB.  And
shouldn't is be "about 187MB" = 187,204KB.

Here's my output from "free", I've got 48MB.

             total       used       free     shared    buffers     cached
Mem:         46048      42260       3788          0       4504      19608
-/+ buffers/cache:      18148      27900
Swap:        85664         68      85596

My kernel seems to be using a little under 2MB so the total "free"
shows doesn't seem to include the kernel code and data.  But the
kernel has reserved several MB for future use per dmesg so I guess
that has been included in "cashed".  So I'm using about 18MB and I
roughly added up the memory for each task (36 of them displayed with
the ps command) and got about 18MB.  I added up the SZ memory and not
the RSS memory.  It looks like ps (for the SZ) may allocate shared
library mem. to the tasks using them.  Does each task get the same
allocation even though some tasks may use a certain shared library far
more than others?  The ps manual doesn't explain it but someone wrote
an article for wikipedia about ps but it fails to explain what SZ is
(could be a new feature of ps).

"pmap" shows what libraries a task is using and the mem. but it
doesn't show how much mem. should be allocated to that task.

			David Lawyer

PS: Disaster struck starting after my wife turned off my PC that was
running a linux hard disk defragment program, but more about that
later as it's a long story and I'm at fault too.  I've at last
completely recovered but it wasn't easy.


More information about the SGVLUG mailing list