LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-07-2013, 12:29 AM   #1
taitran
LQ Newbie
 
Registered: May 2013
Posts: 6

Rep: Reputation: Disabled
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!!!
 
Old 05-07-2013, 12:31 AM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

this page may help: http://www.linuxatemyram.com/

EDIT: Ooops, sorry, I now see that you already understand about disk caching. Do you see anything interesting if you sort the output from top by ram usage?

Evo2.

Last edited by evo2; 05-07-2013 at 01:01 AM.
 
Old 05-07-2013, 01:26 AM   #3
taitran
LQ Newbie
 
Registered: May 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
Hi evo2,

I ran top then pressed 'M' to sort by resident memory usage, I can't tell nothing from there, output below:
Code:
top - 11:56:27 up 4 days,  1:06,  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,  6495916k used,  1566060k free,   145344k 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.27 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
 
Old 05-07-2013, 01:37 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
have you tried ipcs -m ?
and
cat /proc/sys/kernel/shmall

Last edited by pan64; 05-07-2013 at 01:39 AM. Reason: additional info
 
Old 05-07-2013, 02:10 AM   #5
taitran
LQ Newbie
 
Registered: May 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
Hi pan64,

ipcs -m:
Code:
------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status
cat /proc/sys/kernel/shmall:
Code:
4294967296
It seems that 4G of RAM is used for tmpfs, right?
 
Old 05-07-2013, 02:12 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
that is possible, but at this moment I'm not really sure (http://wiki.linuxquestions.org/wiki/Tmpfs)
 
Old 05-07-2013, 02:52 AM   #7
taitran
LQ Newbie
 
Registered: May 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
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.
 
Old 05-07-2013, 03:02 AM   #8
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
glad to help you.
If you really want to say thanks just press yes
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Need an Application that consumes 80% of RAM usage.. danibhai Linux - Newbie 11 09-27-2012 07:55 AM
[SOLVED] Script that names the process in the system that consumes the most memory josecolella Linux - Newbie 4 01-03-2011 07:23 AM
slackware consumes less RAM . shankar Linux - Distributions 4 07-24-2009 04:33 AM
Mystery memory usage - what consumes my RAM? Z038 Linux - General 9 03-20-2006 10:17 PM
RH9 consumes 214MB of Ram? taoweijia Linux - General 4 01-07-2005 01:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration