free -m memstat memory problems

Mutikasa

Power Member
Joined
May 23, 2011
Messages
589
Reaction score
205
Hi,
on Debian squeeze my free -m shows
Code:
             total       used       free     shared    buffers     cached
Mem:           502        476         25          0         83        120
-/+ buffers/cache:        272        230
Swap:          871          3        868
and my memstat shows this
Code:
     36k(     32k): /sbin/init 1
    156k(    132k): /sbin/udevd 354 529 530 354 529 530 354 529 530
--------
  74804k (  23216k)
Why is the difference and why free shows 460MB used when I'm not running any significant process?
I even stopped Apache and it still shows high usage.
 
The memory is not used but is cached so don't worry about it.

type on google "linuxatemyram" and check that page will give you more info about why you see used ram
 
well, according to that site it means I only have 260MB free, which is still low.
I guess memstat is the more precise one
 
You should use top and see which processes is eating your ram in that case.

post the output of top here
 
Code:
top - 11:12:21 up 29 days, 12:23,  1 user,  load average: 0.00, 0.00, 0.00
Tasks:  83 total,   1 running,  82 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:    514564k total,   478984k used,    35580k free,    97076k buffers
Swap:   892920k total,     3256k used,   889664k free,    69928k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
    1 root      20   0  2036  276  248 S    0  0.1   0:29.42 init
    2 root      20   0     0    0    0 S    0  0.0   0:00.10 kthreadd
    3 root      RT   0     0    0    0 S    0  0.0   0:01.74 migration/0
    4 root      20   0     0    0    0 S    0  0.0   0:00.85 ksoftirqd/0
    5 root      RT   0     0    0    0 S    0  0.0   0:00.00 watchdog/0
    6 root      RT   0     0    0    0 S    0  0.0   0:02.49 migration/1
    7 root      20   0     0    0    0 S    0  0.0   0:00.51 ksoftirqd/1
    8 root      RT   0     0    0    0 S    0  0.0   0:00.00 watchdog/1
    9 root      20   0     0    0    0 S    0  0.0   0:22.56 events/0
   10 root      20   0     0    0    0 S    0  0.0   0:22.24 events/1
   11 root      20   0     0    0    0 S    0  0.0   0:00.00 cpuset
   12 root      20   0     0    0    0 S    0  0.0   0:00.00 khelper
   13 root      20   0     0    0    0 S    0  0.0   0:00.00 netns
   14 root      20   0     0    0    0 S    0  0.0   0:00.00 async/mgr
   15 root      20   0     0    0    0 S    0  0.0   0:00.00 pm
   16 root      20   0     0    0    0 S    0  0.0   0:05.28 sync_supers
   17 root      20   0     0    0    0 S    0  0.0   0:04.64 bdi-default

I don't see much
 
True that... somehow your memory is swapped and cached at same time i think that is why you see a lot of used memory

Swap can also occur when the provide it's overselling.

But i am not that experienced so probably ask a professional on some linux sites.
 
Last edited:
Back
Top