• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    CentOS sucking down RAM

    Scheduled Pinned Locked Moved
    Linux Problems
    4
    8
    3.2k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • F
      Fhajad
      last edited by

      For some reason my Fog server (1.1.1) is just chewing through RAM. Currently it’s CentOS 6.5, and was only leaving with 120M free out of 8GB after being online for a while and receiving images and deploying only one. I went ahead and removed GDM so it’s headless, and it manages to creep up on the RAM still it seems.

      Short of the occasional reboot, not sure what to keep an eye on. Top (Sorted by memory) is useless and tells me it’s mostly all free anyway. I used [SIZE=14px][COLOR=#000000][FONT=Consolas]ps -e -o pid,vsz,comm= | sort -n -k 2 [/FONT][/COLOR][/SIZE] to figure out it was GDM as the big culprit, now I’m trying to narrow down the rest.

      1 Reply Last reply Reply Quote 0
      • I
        ianabc Testers
        last edited by

        I’m on RHEL 6.5 and I’m not seeing the same thing,
        [CODE]
        $ free -m
        total used free shared buffers cached
        Mem: 15947 835 15111 0 47 406
        -/+ buffers/cache: 381 15565

        Swap:        16383          0      16383
        

        [/CODE]

        What are you using to judge the free memory? Memory management in linux is quite complex. From memory, the kernel will regard any free space as available for caching, so with longer uptimes you will see little free memory, the actual memory available for applications is the sum of free, buffers and cached.

        1 Reply Last reply Reply Quote 0
        • F
          Fhajad
          last edited by

          I only have an up time of 1 hour 39 minutes, but I only have 121 free also in free -m for comparison, 7621 used.

          1 Reply Last reply Reply Quote 0
          • I
            ianabc Testers
            last edited by

            What are your cached and buffer numbers though? e.g. in mine above the “free” should be 15111 + 47 + 406. I just rebooted that machine so it’s not a great example, here is a better one
            [CODE]
            free -m
            total used free shared buffers cached
            Mem: 7768 6726 1042 0 530 5136
            -/+ buffers/cache: 1058 6710

            Swap: 8191 56 8135
            [/CODE]
            My free for this machine would be 1042 + 530 + 5136 = 6708.

            1 Reply Last reply Reply Quote 0
            • F
              Fhajad
              last edited by

              Here’s my output

              [CODE]-bash-4.1# free -m
              total used free shared buffers cached
              Mem: 7743 7616 126 0 18 7160
              -/+ buffers/cache: 437 7305
              Swap: 7887 0 7887
              -bash-4.1#
              [/CODE]

              1 Reply Last reply Reply Quote 0
              • I
                ianabc Testers
                last edited by

                Hi Fhajad, you have nothing to worry about, the memory is all going to cached which is a good thing!

                Basically accessing memory is much faster than accessing disk so if there is memory not being used, the kernel will keep recently accessed files in there, this speeds up the system considerably. When you need that memory for a running process the caches are dropped automatically and your process is given the memory. The relevant numbers in your output are on the “-/+ buffers/cached” line, you have 437m used and 7305 “free”.

                This might explain better: [url]http://www.thomas-krenn.com/en/wiki/Linux_Page_Cache_Basics[/url]

                Incidentally the idea is similar to filesystems like btrfs and ZFS which use copy-on-write to turn “empty” space into something a bit more useful.

                1 Reply Last reply Reply Quote 0
                • Tom ElliottT
                  Tom Elliott
                  last edited by

                  If you’re really worried about the usage, though, you could add a crontab to clean it all up for a small period of time.

                  I use the crontab:
                  [code]* * * * * sync; echo 3 >| /proc/sys/vm/drop_caches[/code]

                  Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                  Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                  Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                  1 Reply Last reply Reply Quote 1
                  • B
                    braindead
                    last edited by

                    FWIW, I’ve found htop to be a lot more useful than top.

                    1 Reply Last reply Reply Quote 0
                    • 1 / 1
                    • First post
                      Last post

                    242

                    Online

                    12.0k

                    Users

                    17.3k

                    Topics

                    155.2k

                    Posts
                    Copyright © 2012-2024 FOG Project