LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-11-2006, 05:27 PM   #1
richcoosa19
Member
 
Registered: Nov 2002
Location: Rome, GA, USA
Distribution: Slackware 10.1 and Gentoo 2005.1 from Stage 1
Posts: 84

Rep: Reputation: 15
Angry Memory Leak in a program or two?


I have noticed for a while now that occasionally I have to restart my XFCE desktop due to the fact that something has taken up my memory. I do a ps aux and get this and I add up all of the programs' usage and it doesn't add up.

USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 1476 488 ? S Jul10 0:00 init [3]
root 2 0.0 0.0 0 0 ? S Jul10 0:00 [migration/0]
root 3 0.0 0.0 0 0 ? SN Jul10 0:00 [ksoftirqd/0]
root 4 0.0 0.0 0 0 ? S Jul10 0:00 [watchdog/0]
root 5 0.0 0.0 0 0 ? S< Jul10 0:00 [events/0]
root 6 0.0 0.0 0 0 ? S< Jul10 0:00 [khelper]
root 7 0.0 0.0 0 0 ? S< Jul10 0:00 [kthread]
root 9 0.0 0.0 0 0 ? S< Jul10 0:00 [kblockd/0]
root 10 0.0 0.0 0 0 ? S< Jul10 0:00 [kacpid]
root 125 0.0 0.0 0 0 ? S Jul10 0:00 [pdflush]
root 126 0.0 0.0 0 0 ? S Jul10 0:00 [pdflush]
root 128 0.0 0.0 0 0 ? S< Jul10 0:00 [aio/0]
root 127 0.0 0.0 0 0 ? S Jul10 0:00 [kswapd0]
root 129 0.0 0.0 0 0 ? S< Jul10 0:00 [xfslogd/0]
root 130 0.0 0.0 0 0 ? S< Jul10 0:00 [xfsdatad/0]
root 210 0.0 0.0 0 0 ? S< Jul10 0:00 [kseriod]
root 235 0.0 0.0 0 0 ? S< Jul10 0:00 [kpsmoused]
root 308 0.0 0.0 0 0 ? S< Jul10 0:00 [reiserfs/0]
root 514 0.0 0.0 1704 552 ? S<s Jul10 0:00 /sbin/udevd --daemon
root 4576 0.0 0.0 0 0 ? S< Jul10 0:00 [khubd]
root 4616 0.0 0.0 0 0 ? S< Jul10 0:00 [kgameportd]
root 5764 0.0 0.0 1716 568 ? Ss Jul10 0:00 /usr/sbin/syslog-ng
root 6767 0.0 0.2 5044 1848 ? Ss Jul10 0:00 /usr/sbin/cupsd
root 6984 0.0 0.0 1676 364 ? Ss Jul10 0:00 /usr/sbin/gpm -m /dev/input/mice -t ps
root 7999 0.0 0.0 1592 452 ? Ss Jul10 0:00 /usr/sbin/usbd
root 8584 0.0 0.0 1628 248 ? Ss Jul10 0:00 /sbin/dhcpcd -h gentoo-uno eth0
root 8890 0.0 0.3 7800 2432 ? Ss Jul10 0:00 /usr/sbin/smbd -D
root 8892 0.0 0.1 5104 1272 ? Ss Jul10 0:00 /usr/sbin/nmbd -D
root 8911 0.0 0.1 7800 960 ? S Jul10 0:00 /usr/sbin/smbd -D
root 8995 0.0 0.1 3856 948 ? Ss Jul10 0:00 /usr/sbin/sshd
root 9088 0.0 0.0 1728 648 ? Ss Jul10 0:00 /usr/sbin/cron
root 9239 0.0 0.0 1616 680 tty1 Ss+ Jul10 0:00 /sbin/agetty 38400 tty1 linux
root 9240 0.0 0.0 1612 680 tty2 Ss+ Jul10 0:00 /sbin/agetty 38400 tty2 linux
root 9241 0.0 0.0 1616 684 tty3 Ss+ Jul10 0:00 /sbin/agetty 38400 tty3 linux
root 9242 0.0 0.0 1612 680 tty4 Ss+ Jul10 0:00 /sbin/agetty 38400 tty4 linux
root 9263 0.0 0.0 1612 676 tty5 Ss+ Jul10 0:00 /sbin/agetty 38400 tty5 linux
root 9264 0.0 0.0 1616 680 tty6 Ss+ Jul10 0:00 /sbin/agetty 38400 tty6 linux
root 9295 0.0 0.1 9320 1528 ? Ss Jul10 0:00 /usr/bin/gdm
root 11255 0.0 0.3 8108 2868 ? S 18:05 0:00 /usr/sbin/smbd -D
root 11284 0.0 0.2 9852 2308 ? S 18:05 0:00 /usr/bin/gdm
root 11289 1.6 2.9 26400 22848 ? RL 18:05 0:14 /usr/bin/X :0 -audit 0 -auth /var/gdm/
snoopy 11535 0.0 0.1 2636 1028 ? Ss 18:14 0:00 /bin/sh /etc/xdg/xfce4/xinitrc
snoopy 11554 0.0 0.0 3124 548 ? Ss 18:14 0:00 dbus-daemon --fork --print-pid 8 --pri
snoopy 11555 0.0 0.0 2516 620 ? S 18:14 0:00 /usr/bin/dbus-launch --sh-syntax --exi
snoopy 11558 0.0 0.0 3424 552 ? Ss 18:14 0:00 /usr/bin/ssh-agent -- startxfce4
snoopy 11562 0.0 0.0 2636 452 ? S 18:14 0:00 /bin/sh /etc/xdg/xfce4/xinitrc
snoopy 11563 0.0 0.2 3792 1840 ? S 18:14 0:00 xscreensaver -no-splash
snoopy 11567 0.0 0.5 10328 4304 ? S 18:14 0:00 /usr/bin/xfce4-session
snoopy 11569 0.0 0.6 17252 5244 ? Ss 18:14 0:00 xfce-mcs-manager
snoopy 11572 0.2 0.8 11740 6840 ? S 18:14 0:00 xfwm4
snoopy 11574 0.4 1.5 34920 11776 ? S 18:14 0:01 xfce4-panel
snoopy 11576 0.1 0.8 11364 6564 ? S 18:14 0:00 xftaskbar4
snoopy 11578 0.3 1.0 16416 7912 ? S 18:14 0:01 xfdesktop
snoopy 11580 0.1 0.4 5704 3224 ? R 18:15 0:00 xterm -title Terminal
snoopy 11582 0.0 0.1 2840 1452 pts/0 Ss 18:15 0:00 bash
snoopy 11589 0.0 0.3 5560 2640 ? R 18:15 0:00 xterm -title Terminal
snoopy 11591 0.0 0.1 2840 1476 pts/1 Ss 18:15 0:00 bash
snoopy 11596 0.0 0.1 2768 1184 pts/1 S+ 18:16 0:00 /bin/bash /usr/libexec/mozilla-launche
snoopy 11605 9.1 5.2 77516 40564 pts/1 S+ 18:16 0:25 /usr/lib/mozilla-firefox/firefox-bin
snoopy 11618 0.5 1.5 13708 12152 pts/1 S+ 18:16 0:01 /usr/libexec/gconfd-2 12
snoopy 11623 0.0 5.2 77516 40564 pts/1 S+ 18:16 0:00 /usr/lib/mozilla-firefox/firefox-bin
snoopy 11624 0.0 5.2 77516 40564 pts/1 S+ 18:16 0:00 /usr/lib/mozilla-firefox/firefox-bin
snoopy 11625 0.0 5.2 77516 40564 pts/1 S+ 18:16 0:00 /usr/lib/mozilla-firefox/firefox-bin
snoopy 11635 0.0 0.1 2240 984 ? R 18:16 0:00 /usr/libexec/gam_server
snoopy 11656 0.0 0.1 2104 860 pts/0 R+ 18:20 0:00 ps aux

These programs are taking up so my memory that I only have 14MB free! This just doesn't make since! And if I reboot I will have all of the memory given back and free then.

MemTotal: 775076 kB
MemFree: 14016 kB
Buffers: 161636 kB
Cached: 176188 kB
SwapCached: 0 kB
Active: 255260 kB
Inactive: 151284 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 775076 kB
LowFree: 14016 kB
SwapTotal: 955856 kB
SwapFree: 955856 kB
Dirty: 4 kB
Writeback: 0 kB
Mapped: 100428 kB
Slab: 340612 kB
CommitLimit: 1343392 kB
Committed_AS: 95932 kB
PageTables: 1152 kB
VmallocTotal: 245752 kB
VmallocUsed: 29192 kB
VmallocChunk: 214516 kB


What is the deal? Is this normal? Is there anything I can to do fix this reocurring problem? Like I said if I reboot it works fine and gives me back all of the memory, but this is a major inconvenience to me.

Thanks,
Richie
 
Old 07-11-2006, 06:04 PM   #2
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
Do you notice system slow down? Because linux typically uses all the extra memory as cache (speeds up processing). Usually I use free -lm then look at the row that says "-/+ buffers/cache:" (which shows application memory use) and the swap line. The top three lines represent what is used by cache and stuff too. The used column will show what is used by your applications. The free column will show you what is free for applications to use.

So actually from your numbers above, the total memory free for applications should be MemFree + Buffers + Cached. That's why free -lm is so nice...

Last edited by pljvaldez; 07-11-2006 at 06:06 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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Memory leak in X? Mizzou_Engineer Linux - Software 5 04-15-2010 07:28 AM
memory leak ? os2 Programming 1 05-19-2005 01:45 PM
what is memory leak blackzone Programming 6 11-05-2004 10:32 AM
Memory Leak when using memory debugging C program on SuSE SLES8 babalina Linux - Distributions 0 10-06-2003 09:39 AM
Memory Leak FredrikN Linux - General 4 09-17-2002 03:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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