Find the answer to your Linux question:
Results 1 to 9 of 9
I have 8GB RAM on my CentOS box that runs apache and samba serving 1 other host on my network. That is to say it should NOT be using 6GB ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2008
    Location
    SC
    Posts
    54

    Cant explain high memory usage on CentOS 6.5


    I have 8GB RAM on my CentOS box that runs apache and samba serving 1 other host on my network. That is to say it should NOT be using 6GB of RAM.

    Code:
    [root ~]# free -m
                 total       used       free     shared    buffers     cached
    Mem:          7529       7216        312          0        220       1661
    -/+ buffers/cache:       5335       2194
    Swap:         7663          0       7663
    
    [root ~]# ps -eo vsize,comm | sort -n | tail -20
     93200 auditd
     97584 dbus-daemon
    100348 sshd
    100348 sshd
    100944 tail
    108136 ps
    108472 bash
    108472 bash
    110320 abrtd
    117332 crond
    155432 sort
    163880 su
    189888 rsyslogd
    209072 httpd
    209160 httpd
    209160 httpd
    213696 smbd
    214212 smbd
    218152 smbd
    385728 automount
    
    [root ~]# ps h -eo vsz | sort -n | awk '{s+=$1}END{print s}'
    3877852
    Summary
    free -m shows 2194MB free
    ps shows ~4GB used (I realize this may not be a good metric since its VM)

    How do I find where all this memory is going? The only services this box is running that are not default: apache and samba. No users on this box. Run level 3 (no gui).

  2. #2
    Linux Engineer
    Join Date
    Apr 2012
    Location
    Virginia, USA
    Posts
    896

  3. #3
    Just Joined!
    Join Date
    Sep 2008
    Location
    SC
    Posts
    54
    Quote Originally Posted by mizzle View Post
    Ugh, I knew I should have said I already came across that site. It's why I gave up and posted here. Please reread my post. It is clear from the free -m that my CentOS machine is using ~6GB of ram. This is a machine that sees very little use on my network. 6GB of ram to browse a GIT repo and listen to an mp3 from time to time on a single host? Doesn't add up.

  4. #4
    Linux Engineer
    Join Date
    Apr 2012
    Location
    Virginia, USA
    Posts
    896
    Please post the output of
    cat /proc/meminfo

  5. #5
    Just Joined!
    Join Date
    Sep 2008
    Location
    SC
    Posts
    54
    Code:
    [root ~]# cat /proc/meminfo
    MemTotal:        7709876 kB
    MemFree:          323064 kB
    Buffers:          226016 kB
    Cached:          1697172 kB
    SwapCached:            0 kB
    Active:           979636 kB
    Inactive:         965912 kB
    Active(anon):      10020 kB
    Inactive(anon):    20068 kB
    Active(file):     969616 kB
    Inactive(file):   945844 kB
    Unevictable:           0 kB
    Mlocked:               0 kB
    SwapTotal:       7847928 kB
    SwapFree:        7847928 kB
    Dirty:                24 kB
    Writeback:             0 kB
    AnonPages:         22400 kB
    Mapped:            13056 kB
    Shmem:              7728 kB
    Slab:             327632 kB
    SReclaimable:     180680 kB
    SUnreclaim:       146952 kB
    KernelStack:        2280 kB
    PageTables:         5288 kB
    NFS_Unstable:          0 kB
    Bounce:                0 kB
    WritebackTmp:          0 kB
    CommitLimit:    11702864 kB
    Committed_AS:     185612 kB
    VmallocTotal:   34359738367 kB
    VmallocUsed:     4769708 kB
    VmallocChunk:   34354755616 kB
    HardwareCorrupted:     0 kB
    AnonHugePages:      2048 kB
    HugePages_Total:       0
    HugePages_Free:        0
    HugePages_Rsvd:        0
    HugePages_Surp:        0
    Hugepagesize:       2048 kB
    DirectMap4k:        6144 kB
    DirectMap2M:     1753088 kB
    DirectMap1G:     6291456 kB

  6. #6
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,600
    Linux uses as much memory as is available / needed, including for cache. You have 1.5+GB file system buffer cache used. If a program needs it, it will be released for that purpose in an LRU (least-recently used) manner. I also have 8GB of ram, and am only running a few programs (Firefox, VLC, etc), yet it is using 7 of my 8GB RAM, including 5.5+GB file system cache.

    Do bear in mind that Apache does cache a lot of stuff, simply because it expects that there will be further requests for the same pages for your size. Until you hit the swap space, don't fret.

    Disc I/O is the biggest time consumer on systems, so the fact that Linux caches a lot of file system data is not a bad thing - generally it makes the system much faster.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  7. #7
    Just Joined!
    Join Date
    Sep 2008
    Location
    SC
    Posts
    54
    I stopped my samba and apache services and +/- buffers cache free column barely changed. However the total vsize reported by ps showed a difference of 1.5GB. Does this seem unusual? Thanks for the replies.

  8. #8
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,600
    Quote Originally Posted by foxcar View Post
    I stopped my samba and apache services and +/- buffers cache free column barely changed. However the total vsize reported by ps showed a difference of 1.5GB. Does this seem unusual? Thanks for the replies.
    This is not unexpected. The system thinks you may want to restart the services, and you aren't needing that memory at the moment...
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  9. #9
    Just Joined!
    Join Date
    Sep 2008
    Location
    SC
    Posts
    54
    UPDATE: Apparently ZFS does some caching of its own, over 3GB worth on my system. This memory can be released to other processes but this is not reflected in "free -m".

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •