• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 376
  • Last Modified:

how linux uses memory, resultes of "free"

I am a bit confuesd on how linux uses memory

I have a complaint that this box is running out of memory.  

Here is what the customer is sending me:

# free
             total       used       free     shared    buffers     cached
Mem:       5975832    5886316      89516          0     512396    3684660
-/+ buffers/cache:    1689260    4286572
Swap:      2097144          0    2097144

How can I troubleshoot this

Redhat 54

3 Solutions
Yes it is mostly used.

free -m
to get in MB

Also see

to see the processes consuming huge memory.
> -/+ buffers/cache:    1689260    4286572
It means that your system has a lot of memory used as buffers/cacche.
As root, do
# echo 1 > /proc/sys/vm/drop_caches
to release those memory
then after 1 minute, reset back the setting
# echo 0 > /proc/sys/vm/drop_caches

"free" command just give you total memory usage.
Ask them to send you the output of this command
# ps -lef | sort -nk10,10
The 10th column is the memory size and it sort by 10th column with largest memory process at the bottom.
So you know which process use a lot of memory.
What is the complaint?  As long as your SWAP is not in use, that means the memory is managed and is not being exceeded.

Is the performance an issue?  Someone running top, and seeing most of the memory used, is not a reason for concern.

Please see this page to understand how Linux uses memory:

Linux uses memory differently than Windows (which is usually a good thing).  If an application is not using the memory then Linux uses it to cache disk and other things in order to help performance.  If another process needs memory, then those caches areas are cleared so the process can use it.  Your memory looks fine as you aren't using any swap space.
TIMFOX123Author Commented:
Great job

thx all

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now