how linux uses memory, resultes of "free"

Posted on 2011-05-11
Last Modified: 2012-05-11
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

Question by:TIMFOX123
    LVL 31

    Accepted Solution

    Yes it is mostly used.

    free -m
    to get in MB

    Also see

    to see the processes consuming huge memory.
    LVL 38

    Assisted Solution

    > -/+ 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.
    LVL 76

    Expert Comment

    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.

    LVL 12

    Assisted Solution

    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.

    Author Closing Comment

    Great job

    thx all

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. Once you open the link you will see …
    The purpose of this article is to demonstrate how we can use conditional statements using Python.
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
    Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now