LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 01-11-2014, 05:25 PM   #1
cnelson
LQ Newbie
 
Registered: Aug 2010
Posts: 14

Rep: Reputation: 0
Unhappy Where did my memory go?


So, I use to keep about ~50% mem utilization most of the time. Now its almost 100%, even after server reboot! It's a home server nothing taxing, samba, httpd2, webmin, squid, sshd, cups, dnsmasq.

System intel 750mhz 512M ram.(~ 17w CPU) opensuse 12.2

running top shows KiB Mem: 507788 total, 488744 used, 19044 free, 12988 buffers

And running thw following shows
#ps -eo pmem,pcpu,vsize,pid,cmd | sort -k 1 -nr
Code:
2.6  0.0  18984  1806 /usr/bin/perl /usr/libexec/webmin/miniserv.pl /etc/webmin/miniserv.conf
 1.7  0.0  16744  1416 /usr/sbin/squid -F -N -sY -f /etc/squid/squid.conf
 1.6  0.0  25148  1543 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf -D SYSTEMD -k start
 1.0  0.0  25332 15278 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf -D SYSTEMD -k start
 1.0  0.0  25332 15264 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf -D SYSTEMD -k start
 1.0  0.0  25332 15259 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf -D SYSTEMD -k start
 1.0  0.0  25332 15152 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf -D SYSTEMD -k start
 1.0  0.0  25324 15279 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf -D SYSTEMD -k start
 1.0  0.0  25324 15266 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf -D SYSTEMD -k start
 0.9  0.0  25212 15551 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf -D SYSTEMD -k start
 0.9  0.0  25212 15292 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf -D SYSTEMD -k start
 0.9  0.0  25212 15277 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf -D SYSTEMD -k start
 0.9  0.0  25212 15268 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf -D SYSTEMD -k start
 0.9  0.0   6424   492 /usr/sbin/haveged -F 1 -w 1024 -v 0
 0.7  0.4   7232  8177 /usr/sbin/dnsmasq --enable-dbus --keep-in-foreground
 0.7  0.0   8908   493 /usr/sbin/cupsd -f
 0.6  0.0  23324  1463 /usr/sbin/smbd -D -s /etc/samba/smb.conf
 0.6  0.0  22652  1450 /usr/sbin/smbd -D -s /etc/samba/smb.conf
 0.6  0.0  10184 10944 sshd: blah [priv]
 0.6  0.0   5628     1 /sbin/init showopts
 0.4  0.0 619472   259 /lib/systemd/systemd-journald
 0.4  0.0  10332 10946 sshd: blah@pts/0
 0.4  0.0   6888  1409 /usr/sbin/sshd -D
 0.4  0.0   5592 11022 -bash
 0.4  0.0   5564 10947 -bash
 0.3  0.0  11064  1428 /usr/sbin/nmbd -D -s /etc/samba/smb.conf
 0.3  0.0   5736  1868 /usr/sbin/ntpd -p /var/run/ntp/ntpd.pid -g -u ntp:ntp -c /etc/ntp.conf
 0.3  0.0   5352 11021 su -
 0.3  0.0   5224   273 /lib/udev/udevd
 0.2  0.0  38212   537 /sbin/rsyslogd -c 5 -f /etc/rsyslog.conf
 0.2  0.0   5212   383 /lib/udev/udevd
 0.2  0.0   5148  1380 /usr/sbin/cron -n
 0.2  0.0   3560   498 /lib/systemd/systemd-logind
 0.2  0.0   3364   641 /bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
 0.1  0.0   5816 15607 sort -k 1 -nr
 0.1  0.0   5088   368 /lib/udev/udevd
 0.1  0.0   4656   460 /sbin/mount.ntfs /dev/sdd1 /mnt/backup2t -o rw
 0.1  0.0   3236  1431 (unlinkd)
 0.1  0.0   3172 15606 ps -eo pmem,pcpu,vsize,pid,cmd
 0.1  0.0   2704   521 /sbin/mdadm -F -d 60 -m root@localhost -s -c /etc/mdadm.conf
 0.1  0.0   2388  1716 /sbin/agetty tty1 38400
%MEM %CPU    VSZ   PID CMD
 0.0  0.0      0 15506 [kworker/0:2]
 0.0  0.0      0 15137 [kworker/0:1]
 0.0  0.0      0   485 [ext4-dio-unwrit]
 0.0  0.0      0   484 [jbd2/sda7-8]
 0.0  0.0      0   482 [ext4-dio-unwrit]
 0.0  0.0      0   478 [jbd2/md0-8]
 0.0  0.0      0   475 [kjournald]
 0.0  0.0      0   462 [kjournald]
 0.0  0.0      0   446 [md0_raid5]
 0.0  0.0      0   425 [reiserfs]
 0.0  0.0      0   260 [kauditd]
 0.0  0.0      0   220 [flush-8:0]
 0.0  0.0      0   213 [ext4-dio-unwrit]
 0.0  0.0      0   212 [jbd2/sda6-8]
 0.0  0.0      0   122 [kworker/u:6]
 0.0  0.0      0   121 [khubd]
 0.0  0.0      0   120 [kworker/u:5]
 0.0  0.0      0   119 [scsi_eh_8]
 0.0  0.0      0   117 [scsi_eh_7]
 0.0  0.0      0   115 [scsi_eh_6]
 0.0  0.0      0   113 [scsi_eh_5]
 0.0  0.0      0   112 [scsi_eh_4]
 0.0  0.0      0   111 [scsi_eh_3]
 0.0  0.0      0   110 [scsi_eh_2]
 0.0  0.0      0    76 [kmpath_rdacd]
 0.0  0.0      0    68 [scsi_eh_1]
 0.0  0.0      0    67 [scsi_eh_0]
 0.0  0.0      0    62 [ata_sff]
 0.0  0.0      0    29 [deferwq]
 0.0  0.0      0    27 [kpsmoused]
 0.0  0.0      0    26 [kthrotld]
 0.0  0.0      0    22 [crypto]
 0.0  0.0      0    21 [fsnotify_mark]
 0.0  0.0      0    20 [ksmd]
 0.0  0.0      0    19 [kswapd0]
 0.0  0.0      0    18 [khungtaskd]
 0.0  0.0      0    16 [md]
 0.0  0.0      0    15 [kblockd]
 0.0  0.0      0    14 [kintegrityd]
 0.0  0.0      0    13 [bdi-default]
 0.0  0.0      0    12 [sync_supers]
 0.0  0.0      0    11 [netns]
 0.0  0.0      0    10 [kdevtmpfs]
 0.0  0.0      0     9 [khelper]
 0.0  0.0      0     8 [cpuset]
 0.0  0.0      0     7 [watchdog/0]
 0.0  0.0      0     6 [migration/0]
 0.0  0.0      0     3 [ksoftirqd/0]
 0.0  0.0      0     2 [kthreadd]
Like nothing is using it.

But the follow suggests 400M is sucked up as cached??
# cat /proc/memingo
Code:
MemTotal:         507788 kB
MemFree:           19184 kB
Buffers:           14564 kB
Cached:           403320 kB
SwapCached:            0 kB
Active:           136024 kB
Inactive:         323948 kB
Active(anon):      14072 kB
Inactive(anon):    28488 kB
Active(file):     121952 kB
Inactive(file):   295460 kB
Unevictable:           0 kB
Mlocked:               0 kB
HighTotal:             0 kB
HighFree:              0 kB
LowTotal:         507788 kB
LowFree:           19184 kB
SwapTotal:       1050620 kB
SwapFree:        1050620 kB
Dirty:                72 kB
Writeback:             0 kB
AnonPages:         42084 kB
Mapped:            18484 kB
Shmem:               460 kB
Slab:              18124 kB
SReclaimable:      10424 kB
SUnreclaim:         7700 kB
KernelStack:         736 kB
PageTables:         1056 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     1304512 kB
Committed_AS:     145440 kB
VmallocTotal:     509176 kB
VmallocUsed:        3796 kB
VmallocChunk:     505008 kB
HardwareCorrupted:     0 kB
AnonHugePages:         0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       4096 kB
DirectMap4k:       43776 kB
DirectMap4M:      479232 kB
So what is eating all that cache? my squid isn't. Running a pmap -x on it shows under 16740K used for that. dnsmasq (my next assumption because of multiple giant host files that got 5x larger recently) pmap -x shows 7228K.

So how can I chase down what is going on, and what changed to eat up that ram?

Occasionally I'll run another service on that box(like wolfet for LAN), and also want to see about moving a 100m VM under it.
 
Old 01-11-2014, 05:39 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
Read this
 
Old 01-11-2014, 07:27 PM   #3
cnelson
LQ Newbie
 
Registered: Aug 2010
Posts: 14

Original Poster
Rep: Reputation: 0
while I appreciate the response, I knew it was cache(as per my cating /proc/meminfo), I'm still confused why it is grabbing all of it now, when about year ago it wasn't behaving this way?(or top was reporting it different)

Is there no way to see what its grabbing or why?

Thanks again.
 
Old 01-11-2014, 10:01 PM   #4
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,264
Blog Entries: 24

Rep: Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195
Quote:
Originally Posted by cnelson View Post
while I appreciate the response, I knew it was cache(as per my cating /proc/meminfo), I'm still confused why it is grabbing all of it now, when about year ago it wasn't behaving this way?(or top was reporting it different)

Is there no way to see what its grabbing or why?

Thanks again.
Linux has worked this way for a very long time. Of course, we have no way of knowing what you were running or how it was working a year ago, it is more likely that your recollection is incorrect, or that you were looking at it differently than now.

Also, I would emphasize again as stated in the linked article - nothing is grabbing anything. You need to read the article once more and understand that no memory is being grabbed, and free yourself of that misconception. Use of free memory as disk cache is a good thing and totally free, not a problem in any sense of the word.

Follow the link at the bottom of the article to see how to clear the cached memory, and see how it is being used.

Last edited by astrogeek; 01-11-2014 at 10:05 PM.
 
  


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
Live DVD runs out of memory - using swap - free memory doesn't help at upgrade .... LiNuXkOlOnIe Linux - Distributions 3 06-09-2013 09:35 PM
Error while saving memory pages of a process- Sleeping in memory from invalid context Deep Narayan Dubey Linux - Kernel 1 04-05-2012 02:58 PM
Memory leaks.. *** glibc detected *** ./SuffixTree: malloc(): memory corruption: 0x00 evansash Programming 12 03-21-2011 01:17 PM
Difference between resident memory,shared memory and virtual memory in system monitor mathimca05 Linux - Newbie 1 11-11-2007 04:05 AM
Help!?! RH 8 Memory Mapping -High Memory-Virtural Memory issues.. Merlin53 Linux - Hardware 2 06-18-2003 04:48 PM

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

All times are GMT -5. The time now is 09:39 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