Linux - Server This forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to
LinuxQuestions.org , a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free.
Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please
contact us . If you need to reset your password,
click here .
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a
virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month.
Click here for more info.
05-07-2013, 12:29 AM
#1
LQ Newbie
Registered: May 2013
Posts: 6
Rep:
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!!!
05-07-2013, 12:31 AM
#2
LQ Guru
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724
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 .
05-07-2013, 01:26 AM
#3
LQ Newbie
Registered: May 2013
Posts: 6
Original Poster
Rep:
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
05-07-2013, 01:37 AM
#4
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842
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
05-07-2013, 02:10 AM
#5
LQ Newbie
Registered: May 2013
Posts: 6
Original Poster
Rep:
Hi pan64,
ipcs -m:
Code:
------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
cat /proc/sys/kernel/shmall:
It seems that 4G of RAM is used for tmpfs, right?
05-07-2013, 02:12 AM
#6
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842
that is possible, but at this moment I'm not really sure (
http://wiki.linuxquestions.org/wiki/Tmpfs )
05-07-2013, 02:52 AM
#7
LQ Newbie
Registered: May 2013
Posts: 6
Original Poster
Rep:
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.
05-07-2013, 03:02 AM
#8
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842
glad to help you.
If you really want to say thanks just press yes
1 members found this post helpful.
All times are GMT -5. The time now is 03:12 PM .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know .
Latest Threads
LQ News