Find the answer to your Linux question:
Results 1 to 10 of 10
I have just been provided a CentOS 64-bit system with 8 GB of RAM at work. I did a little investigation about the hardware, and especially free RAM as I ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2013
    Posts
    6

    Help: don't know what consumes so much RAM on my CentOS system


    I have just been provided a CentOS 64-bit system with 8 GB of RAM at work. I did a little investigation about the hardware, and especially free RAM as I will install Oracle on this machine.

    "free -m" shows:
    Code:
                 total       used       free     shared    buffers     cached
    Mem:          7873       6194       1678          0        137        689
    -/+ buffers/cache:       5366       2506
    Swap:          399          0        399
    OK, then I understand that I have around 2506 MB left out of 8 GB. That's suspicious for a fresh new system. I started to do more investigation to find out where the RAM goes to.

    "cat /proc/meminfo" shows:
    Code:
    MemTotal:        8061976 kB
    MemFree:         1705056 kB
    Buffers:          141596 kB
    Cached:           719636 kB
    SwapCached:            0 kB
    Active:           166380 kB
    Inactive:         715072 kB
    Active(anon):      20420 kB
    Inactive(anon):        8 kB
    Active(file):     145960 kB
    Inactive(file):   715064 kB
    Unevictable:           0 kB
    Mlocked:               0 kB
    SwapTotal:        409592 kB
    SwapFree:         409592 kB
    Dirty:               244 kB
    Writeback:             0 kB
    AnonPages:         20260 kB
    Mapped:            14704 kB
    Shmem:               168 kB
    Slab:             133880 kB
    SReclaimable:      80680 kB
    SUnreclaim:        53200 kB
    KernelStack:         944 kB
    PageTables:         3760 kB
    NFS_Unstable:          0 kB
    Bounce:                0 kB
    WritebackTmp:          0 kB
    CommitLimit:     4440580 kB
    Committed_AS:     112956 kB
    VmallocTotal:   34359738367 kB
    VmallocUsed:      288436 kB
    VmallocChunk:   34359438716 kB
    HardwareCorrupted:     0 kB
    AnonHugePages:         0 kB
    HugePages_Total:       0
    HugePages_Free:        0
    HugePages_Rsvd:        0
    HugePages_Surp:        0
    Hugepagesize:       2048 kB
    DirectMap4k:       10240 kB
    DirectMap2M:     8378368 kB
    The result looks align with free's report.

    "top -a":
    Code:
    top - 10:40:58 up 3 days, 23:50,  3 users,  load average: 0.00, 0.00, 0.00
    Tasks: 109 total,   1 running, 108 sleeping,   0 stopped,   0 zombie
    Cpu(s):  0.0%us,  0.2%sy,  0.0%ni, 99.7%id,  0.0%wa,  0.0%hi,  0.2%si,  0.0%st
    Mem:   8061976k total,  6365228k used,  1696748k free,   141772k buffers
    Swap:   409592k total,        0k used,   409592k free,   727316k cached
    
      PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
    29231 root      20   0 97812 4064 3148 S  0.0  0.1   0:00.30 sshd
    29682 root      20   0 97812 4060 3148 S  0.0  0.1   0:00.22 sshd
     1380 haldaemo  20   0 25320 3764 2812 S  0.0  0.0   0:13.31 hald
     1346 root      20   0  184m 3316 2444 S  0.0  0.0   0:00.01 cupsd
     1552 postfix   20   0 78920 3280 2456 S  0.0  0.0   0:04.47 qmgr
     1545 root      20   0 78668 3244 2408 S  0.0  0.0   0:08.03 master
    29587 postfix   20   0 78748 3220 2412 S  0.0  0.0   0:00.07 pickup
     1621 root      20   0 77088 2696 2112 S  0.0  0.0   0:00.21 login
      808 root      18  -2 12384 2600  568 S  0.0  0.0   0:00.07 udevd
     1436 root      18  -2 12392 2592  548 S  0.0  0.0   0:00.04 udevd
    29235 tatran    20   0 97812 1984 1032 S  0.0  0.0   0:03.84 sshd
     1710 root      20   0  105m 1916 1528 S  0.0  0.0   0:00.07 bash
    29686 tatran    20   0 97812 1888  968 S  0.0  0.0   0:00.06 sshd
    29236 tatran    20   0  105m 1856 1468 S  0.0  0.0   0:00.66 bash
    29687 tatran    20   0  105m 1840 1468 S  0.0  0.0   0:00.11 bash
    29589 tatran    20   0  134m 1808 1492 S  0.3  0.0   0:11.51 wget
     1134 root      20   0  243m 1804 1092 S  0.0  0.0   0:22.49 rsyslogd
    "ps -e -orss=,size=,args= | sort -b -n":
    Code:
        0     0 [aio/0]
        0     0 [aio/1]
        0     0 [async/mgr]
        0     0 [ata/0]
        0     0 [ata/1]
        0     0 [ata_aux]
        0     0 [bdi-default]
        0     0 [cgroup]
        0     0 [crypto/0]
        0     0 [crypto/1]
        0     0 [events/0]
        0     0 [events/1]
        0     0 [ext4-dio-unwrit]
        0     0 [ext4-dio-unwrit]
        0     0 [ext4-dio-unwrit]
        0     0 [ext4-dio-unwrit]
        0     0 [flush-8:0]
        0     0 [jbd2/sda1-8]
        0     0 [jbd2/sda3-8]
        0     0 [kacpid]
        0     0 [kacpi_hotplug]
        0     0 [kacpi_notify]
        0     0 [kauditd]
        0     0 [kblockd/0]
        0     0 [kblockd/1]
        0     0 [khelper]
        0     0 [khubd]
        0     0 [khugepaged]
        0     0 [khungtaskd]
        0     0 [kintegrityd/0]
        0     0 [kintegrityd/1]
        0     0 [kpsmoused]
        0     0 [kseriod]
        0     0 [ksmd]
        0     0 [ksoftirqd/0]
        0     0 [ksoftirqd/1]
        0     0 [kstriped]
        0     0 [ksuspend_usbd]
        0     0 [kswapd0]
        0     0 [kthreadd]
        0     0 [kthrotld/0]
        0     0 [kthrotld/1]
        0     0 [md/0]
        0     0 [md/1]
        0     0 [md_misc/0]
        0     0 [md_misc/1]
        0     0 [migration/0]
        0     0 [migration/0]
        0     0 [migration/1]
        0     0 [migration/1]
        0     0 [mpt/0]
        0     0 [mpt_poll_0]
        0     0 [netns]
        0     0 [pciehpd]
        0     0 [pm]
        0     0 [rpciod/0]
        0     0 [rpciod/1]
        0     0 [scsi_eh_0]
        0     0 [scsi_eh_1]
        0     0 [scsi_eh_2]
        0     0 [sync_supers]
        0     0 [usbhid_resumer]
        0     0 [vmmemctl]
        0     0 [watchdog/0]
        0     0 [watchdog/1]
      472   480 /usr/sbin/atd
      512   296 avahi-daemon: chroot helper
      532   312 rpc.idmapd
      568   268 /usr/sbin/mcelog --daemon
      588   268 /sbin/mingetty /dev/tty2
      592   268 /sbin/mingetty /dev/tty5
      592   268 /sbin/mingetty /dev/tty6
      596   268 /sbin/mingetty /dev/tty3
      596   268 /sbin/mingetty /dev/tty4
      644   268 /usr/sbin/acpid
      828 10552 auditd
      840 50464 sort -b -n
      892   304 rpcbind
      896   376 /usr/sbin/certmonger -S -p /var/run/certmonger.pid
      948   268 abrt-dump-oops -d /var/spool/abrt -rwx /var/log/messages
      964  1056 ps -e -orss=,size=,args=
     1016   268 /usr/sbin/abrtd
     1152   292 hald-addon-acpi: listening on acpid socket /var/run/acpid.socket
     1164   608 /usr/sbin/sshd
     1224 10668 dbus-daemon --system
     1240   288 hald-addon-input: Listening on /dev/input/event2 /dev/input/event0
     1304   292 hald-runner
     1348   524 rpc.statd
     1376  1424 crond
     1556   416 /sbin/init
     1568  1344 /sbin/udevd -d
     1616   296 avahi-daemon: running [in-mum-vmmdb.local]
     1760 350120 automount --pid-file /var/run/autofs.pid
     1804 227820 /sbin/rsyslogd -i /var/run/syslogd.pid -c 5
     1840   424 -bash
     1856   424 -bash
      1916   420 -bash
      2592  2132 /sbin/udevd -d
     2600  2124 /sbin/udevd -d
     2696   696 login -- root
     3220   600 pickup -l -t fifo -u
     3244   596 /usr/libexec/postfix/master
     3280   704 qmgr -l -t fifo -u
     3316   712 cupsd -C /etc/cups/cupsd.conf
     3764   964 hald
     4060   792 sshd: tatran [priv]
     4064   792 sshd: tatran [priv]
    I still can't figure out where a large portion of RAM goes to, the system seems not to have any big processes running.

    Please help. Thanks in advance!!!

  2. #2
    Linux Newbie
    Join Date
    Jan 2013
    Posts
    116
    run below command:

    >top -c

    It show top cpu consuming processes, to see memory consuing processes press 'm'

  3. #3
    Just Joined!
    Join Date
    May 2013
    Posts
    6
    Quote Originally Posted by NixSavy View Post
    run below command:

    >top -c

    It show top cpu consuming processes, to see memory consuing processes press 'm'
    I ran top then pressed 'M' to sort by resident memory usage, I can't tell nothing from there, output below:
    Code:
    top - 11:54:54 up 4 days,  1:04,  3 users,  load average: 0.00, 0.00, 0.00
    Tasks: 108 total,   1 running, 107 sleeping,   0 stopped,   0 zombie
    Cpu(s):  0.0%us,  0.2%sy,  0.0%ni, 99.8%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
    Mem:   8061976k total,  6495792k used,  1566184k free,   145320k buffers
    Swap:   409592k total,        0k used,   409592k free,   850788k cached
    
      PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
    29231 root      20   0 97812 4064 3148 S  0.0  0.1   0:00.32 sshd
    29682 root      20   0 97812 4060 3148 S  0.0  0.1   0:00.23 sshd
     1380 haldaemo  20   0 25320 3764 2812 S  0.0  0.0   0:13.57 hald
     1346 root      20   0  184m 3316 2444 S  0.0  0.0   0:00.01 cupsd
     1552 postfix   20   0 78920 3280 2456 S  0.0  0.0   0:04.50 qmgr
     1545 root      20   0 78668 3244 2408 S  0.0  0.0   0:08.28 master
    29910 postfix   20   0 78748 3220 2412 S  0.0  0.0   0:00.09 pickup
     1621 root      20   0 77088 2696 2112 S  0.0  0.0   0:00.21 login
      808 root      18  -2 12384 2600  568 S  0.0  0.0   0:00.07 udevd
     1436 root      18  -2 12392 2592  548 S  0.0  0.0   0:00.04 udevd
    29235 tatran    20   0 97812 1984 1032 S  0.0  0.0   0:06.00 sshd
    29686 tatran    20   0 97812 1968 1032 S  0.0  0.0   0:00.24 sshd
     1710 root      20   0  105m 1916 1528 S  0.0  0.0   0:00.07 bash
    29236 tatran    20   0  105m 1856 1468 S  0.0  0.0   0:00.66 bash
    29687 tatran    20   0  105m 1840 1468 S  0.0  0.0   0:00.17 bash
     1134 root      20   0  243m 1808 1092 S  0.0  0.0   0:22.50 rsyslogd
     1441 root      20   0  376m 1760 1284 S  0.0  0.0   0:28.11 automount

  4. #4
    Linux Newbie
    Join Date
    Jan 2013
    Posts
    116
    If I compare your output of top with current output of top you have updated, it seems you have copy paste the same output, there is not a bit change in PIDs, As I have monitored servers PID's changes with time interval, can you please update the outpur of below command it seems there is any configuration issue.

    >top -c

  5. #5
    Just Joined!
    Join Date
    May 2013
    Posts
    6
    Quote Originally Posted by NixSavy View Post
    If I compare your output of top with current output of top you have updated, it seems you have copy paste the same output, there is not a bit change in PIDs, As I have monitored servers PID's changes with time interval, can you please update the outpur of below command it seems there is any configuration issue.

    >top -c
    I did not copy/paste, the last info was a rerun from the same login session. As I said this is a new system, I have not installed or run anything on it yet.

    Below is output from "top -c":
    Code:
    top - 12:27:55 up 4 days,  1:37,  3 users,  load average: 0.00, 0.00, 0.00
    Tasks: 111 total,   1 running, 110 sleeping,   0 stopped,   0 zombie
    Cpu(s):  0.0%us,  0.2%sy,  0.0%ni, 99.8%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
    Mem:   8061976k total,  6851388k used,  1210588k free,   145864k buffers
    Swap:   409592k total,        0k used,   409592k free,  1194280k cached
    
      PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
    30144 tatran    20   0 15028 1192  928 R  0.7  0.0   0:00.03 top -c
        1 root      20   0 19352 1556 1244 S  0.0  0.0   0:05.24 /sbin/init
        2 root      20   0     0    0    0 S  0.0  0.0   0:00.00 [kthreadd]
        3 root      RT   0     0    0    0 S  0.0  0.0   0:07.84 [migration/0]
        4 root      20   0     0    0    0 S  0.0  0.0   0:00.53 [ksoftirqd/0]
        5 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 [migration/0]
        6 root      RT   0     0    0    0 S  0.0  0.0   0:06.82 [watchdog/0]
        7 root      RT   0     0    0    0 S  0.0  0.0   0:03.00 [migration/1]
        8 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 [migration/1]
        9 root      20   0     0    0    0 S  0.0  0.0   0:02.57 [ksoftirqd/1]
       10 root      RT   0     0    0    0 S  0.0  0.0   0:36.33 [watchdog/1]
       11 root      20   0     0    0    0 S  0.0  0.0   0:26.00 [events/0]
       12 root      20   0     0    0    0 S  0.0  0.0   5:15.34 [events/1]
       13 root      20   0     0    0    0 S  0.0  0.0   0:00.00 [cgroup]
       14 root      20   0     0    0    0 S  0.0  0.0   0:00.00 [khelper]
       15 root      20   0     0    0    0 S  0.0  0.0   0:00.00 [netns]
       16 root      20   0     0    0    0 S  0.0  0.0   0:00.00 [async/mgr]
    And the output after I pressed M:
    Code:
    top - 12:28:26 up 4 days,  1:38,  3 users,  load average: 0.00, 0.00, 0.00
    Tasks: 111 total,   1 running, 110 sleeping,   0 stopped,   0 zombie
    Cpu(s):  0.0%us,  0.2%sy,  0.0%ni, 99.8%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
    Mem:   8061976k total,  6851388k used,  1210588k free,   145872k buffers
    Swap:   409592k total,        0k used,   409592k free,  1194280k cached
    
      PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
    29231 root      20   0 97812 4064 3148 S  0.0  0.1   0:00.35 sshd: tatran [priv]
    30105 root      20   0 97812 4060 3148 S  0.0  0.1   0:00.36 sshd: tatran [priv]
    30009 root      20   0 97808 3812 2900 S  0.0  0.0   0:00.35 sshd: tatran [priv]
     1380 haldaemo  20   0 25320 3764 2812 S  0.0  0.0   0:13.61 hald
     1346 root      20   0  184m 3316 2444 S  0.0  0.0   0:00.01 cupsd -C /etc/cups/
     1552 postfix   20   0 78920 3280 2456 S  0.0  0.0   0:04.50 qmgr -l -t fifo -u
     1545 root      20   0 78668 3244 2408 S  0.0  0.0   0:08.32 /usr/libexec/postfi
    29910 postfix   20   0 78748 3220 2412 S  0.0  0.0   0:00.12 pickup -l -t fifo -
     1621 root      20   0 77088 2696 2112 S  0.0  0.0   0:00.21 login -- root
      808 root      18  -2 12384 2600  568 S  0.0  0.0   0:00.07 /sbin/udevd -d
     1436 root      18  -2 12392 2592  548 S  0.0  0.0   0:00.04 /sbin/udevd -d
    30015 tatran    20   0 55152 2132 1572 S  0.0  0.0   0:00.07 /usr/libexec/openss
    29235 tatran    20   0 97812 1984 1032 S  0.0  0.0   0:06.25 sshd: tatran@pts/0
    30014 tatran    20   0 97808 1944 1020 S  0.0  0.0   0:00.06 sshd: tatran@notty
     1710 root      20   0  105m 1916 1528 S  0.0  0.0   0:00.07 -bash
    30109 tatran    20   0 97812 1888  968 S  0.0  0.0   0:00.03 sshd: tatran@pts/1
    29236 tatran    20   0  105m 1880 1468 S  0.0  0.0   0:00.81 -bash

  6. #6
    Just Joined!
    Join Date
    May 2013
    Posts
    6
    It seems that 4G RAM is reserved for tmpfs as shown by "df -h" command:
    Code:
    Filesystem            Size  Used Avail Use% Mounted on
    /dev/sda3              39G  3.2G   34G   9% /
    tmpfs                 3.9G     0  3.9G   0% /dev/shm
    /dev/sda1              97M   32M   61M  34% /boot
    Anyone can help confirm this?

  7. #7
    Linux Newbie
    Join Date
    Jan 2013
    Posts
    116
    df -h display disk space consumption not memory consumption on server. and tmpfs using 0 disk space 4GB is free.

  8. #8
    Just Joined!
    Join Date
    May 2013
    Posts
    6
    Quote Originally Posted by NixSavy View Post
    df -h display disk space consumption not memory consumption on server. and tmpfs using 0 disk space 4GB is free.
    Then do you know how to check if this tmpfs partition is hosted on RAM?

  9. #9
    Linux Newbie
    Join Date
    Jan 2013
    Posts
    116
    we can't use RAM to host anything, it used only to store processing data temporary. Here tmpfs mounted with /dev/shm, To monitor memory you can also run below command:

    >htop

    and then press M

    or if you have not installed then you can install with yum.

    Thanks

  10. #10
    Just Joined!
    Join Date
    May 2013
    Posts
    6
    Hey, now the free memory report is OK now after I installed Oracle Express, it complained not enough swap space (399 MB). I added a 2G swap space from file and mounted it, then VOILA, free -m now shows:
    Code:
                 total       used       free     shared    buffers     cached
    Mem:          7873       4007       3865          0         78       3603
    -/+ buffers/cache:        325       7547
    Swap:         2447          0       2447
    7547 MB as free memory, don't know why it works like that but anyways, it is SOLVED. Thanks all.

Posting Permissions

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