LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Reply
 
Search this Thread
Old 08-03-2005, 07:12 AM   #1
xushi
Senior Member
 
Registered: Jun 2003
Location: UK
Distribution: Gentoo
Posts: 1,288

Rep: Reputation: 45
frustrating memory leaks


I've been having alot of mem leaks the past month with my system, and i can't figure out the cause or pointpoint the application...

I have 512Mb, with a swap of 256Mb. I've never had to use my swap file, even with apache, mysql, and several apps running. But nowadays, after a day or two of usage, i notice swap usage slowly goes up to 6Mb, then up to 50Mb, and even 90Mb. My system starts to be come less responsive and just .. well.. slower than usual.

At first, i thought aMule was causing the problem, and i've asked the devs at #amule, and they said that because i have it compiled with gtk2, gtk2 can sometimes cause mem leaks. But closing amule doesn't get rid of all the swap usage, and sometimes i do get swap usage without using amule at all.

Even if i logoff and log back in, swap is still being used. The only way to empty it out is either
swapoff /dev/hda2 && swapon /dev/hda2
or a reboot.

I don't know of any utilities that show swap usage per application. The only utilities i use are torsmo, top, and sometimes ksysguard.

Any advice?
Thanks.

Edit: If it helps, my current mem info,
torsmo: 183M/502M - 36%
swap: 0/256M - 0% (coz i just restarted my swap)

Code:
             total       used       free     shared    buffers     cached
Mem:           502        495          6          0          8        302
-/+ buffers/cache:        184        317
Swap:          243          0        243

Last edited by xushi; 08-03-2005 at 07:17 AM.
 
Old 08-03-2005, 07:16 AM   #2
keefaz
Senior Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 4,617

Rep: Reputation: 136Reputation: 136
One time, I saw the swap being used completly
(and it was a 1GB swap partition !)

Running top showed me that it was updatedb that caused this
(this was a long time and it never happen again tough)
 
Old 08-03-2005, 07:19 AM   #3
xushi
Senior Member
 
Registered: Jun 2003
Location: UK
Distribution: Gentoo
Posts: 1,288

Original Poster
Rep: Reputation: 45
What is it in 'top' that shows swap usage?
VIRT ?

I'll dump a 'top' here when i get another leak.
 
Old 08-03-2005, 07:54 AM   #4
keefaz
Senior Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 4,617

Rep: Reputation: 136Reputation: 136
I read the top man page, although it is clear, in practice top
shows used swap for each process but not free nor
cat /proc/meminfo ...

When I had the updatedb problem, I saw the used swap
from the 5th line from the top of top and the % of memory
used by updatedb at this time (99% or so)
 
Old 08-03-2005, 02:22 PM   #5
xushi
Senior Member
 
Registered: Jun 2003
Location: UK
Distribution: Gentoo
Posts: 1,288

Original Poster
Rep: Reputation: 45
Code:
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND           
26062 root      14  -1  107m  31m 6372 S  1.0  6.2  37:45.39 X                  
26110 root      16   0 11540 6336 5364 S  0.3  1.2   0:05.23 xfwm4              
26208 root      15   0 53620  24m  10m S  0.3  4.8   7:58.14 amule              
27690 root      16   0  268m  55m  18m S  0.3 11.0   0:12.37 java               
    1 root      16   0   680   68   44 S  0.0  0.0   0:00.63 init               
    2 root      34  19     0    0    0 S  0.0  0.0   0:03.15 ksoftirqd/0        
    3 root      10  -5     0    0    0 S  0.0  0.0   0:00.95 events/0           
    4 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 khelper            
    5 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 kthread            
    7 root      10  -5     0    0    0 S  0.0  0.0   0:00.05 kacpid             
   81 root      10  -5     0    0    0 S  0.0  0.0   0:02.00 kblockd/0          
   84 root      16   0     0    0    0 S  0.0  0.0   0:00.00 khubd              
  144 root      15   0     0    0    0 S  0.0  0.0   0:18.04 kswapd0            
  145 root      20  -5     0    0    0 S  0.0  0.0   0:00.00 aio/0              
  165 root      15   0     0    0    0 S  0.0  0.0   0:00.00 shpchpd_event      
  241 root      15   0     0    0    0 S  0.0  0.0   0:00.02 kseriod            
  284 root      15   0     0    0    0 S  0.0  0.0   0:00.00 khpsbpkt
Swap usage at 90Mb. Closed Azureus, and it dropped to 70Mb ...
 
Old 08-03-2005, 02:24 PM   #6
keefaz
Senior Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 4,617

Rep: Reputation: 136Reputation: 136
I would suspect java
(What are these 268 MB resources used by java at VIRT field ?)

Last edited by keefaz; 08-03-2005 at 02:56 PM.
 
Old 08-03-2005, 03:34 PM   #7
xushi
Senior Member
 
Registered: Jun 2003
Location: UK
Distribution: Gentoo
Posts: 1,288

Original Poster
Rep: Reputation: 45
I haven't the slightest clue... All i was running was Azureus.

And now i closed it, and i'm still stuck with 70Mb swap..
Code:
26062 root      15  -1  103m  27m 7596 S  6.7  5.4  46:26.89 X                  
26208 root      15   0 54296  26m  11m S  1.0  5.2   8:54.33 amule              
26094 root      15   0 11940 4472 3872 S  0.3  0.9   0:03.73 xfce-mcs-manage    
26112 root      15   0 14356 6660 5732 S  0.3  1.3   0:02.57 xfce4-panel        
26178 root      15   0 15704 7400 5864 S  0.3  1.4   0:08.79 xchat              
28450 root      16   0 93988  33m  13m S  0.3  6.6   0:11.27 firefox-bin        
    1 root      16   0   680   68   44 S  0.0  0.0   0:00.65 init               
    2 root      34  19     0    0    0 S  0.0  0.0   0:03.15 ksoftirqd/0        
    3 root      10  -5     0    0    0 S  0.0  0.0   0:00.96 events/0           
    4 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 khelper            
    5 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 kthread            
    7 root      10  -5     0    0    0 S  0.0  0.0   0:00.06 kacpid             
   81 root      10  -5     0    0    0 S  0.0  0.0   0:02.00 kblockd/0          
   84 root      16   0     0    0    0 S  0.0  0.0   0:00.00 khubd              
  144 root      15   0     0    0    0 S  0.0  0.0   0:18.11 kswapd0            
  145 root      20  -5     0    0    0 S  0.0  0.0   0:00.00 aio/0              
  165 root      15   0     0    0    0 S  0.0  0.0   0:00.00 shpchpd_
I mean it can't be that every app i have running is leaking memory... And these are the identical apps (almost to the version) that i had on 4 other systems that worked perfectly.

edit: a better pic here
http://xushi.co.uk/xushi/sv/top.jpg

Last edited by xushi; 08-03-2005 at 03:38 PM.
 
Old 08-03-2005, 03:50 PM   #8
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 52
did all those systems also use the same kernel ?
maybe you can try to set the " swappiness " to a lower value.

i believe the default is 60 so i would try :

echo 10 >/proc/sys/vm/swappiness

( or maybe even "1" )

egag
 
Old 08-03-2005, 04:23 PM   #9
bird603568
Member
 
Registered: Aug 2004
Distribution: Slackware current
Posts: 250

Rep: Reputation: 30
The answer is firefox I left forefox open for a week on end and it leaked about a 1.25 gigs of ram. (I have 2 gig)
 
Old 08-03-2005, 05:00 PM   #10
xushi
Senior Member
 
Registered: Jun 2003
Location: UK
Distribution: Gentoo
Posts: 1,288

Original Poster
Rep: Reputation: 45
Quote:
Originally posted by egag
did all those systems also use the same kernel ?
maybe you can try to set the " swappiness " to a lower value.

i believe the default is 60 so i would try :

echo 10 >/proc/sys/vm/swappiness

( or maybe even "1" )

egag
Hmm, no, they had up to 2.6.11.12. This laptop's running on 2.6.12.3.

As for swappiness, heh, what is that anyway? never heard of it before..

As for FF.. it might be imprefect, but i havent seen it leek memory like that before. And why doesn't my swap reduce in size when i close it ?

:'(
 
Old 08-03-2005, 05:15 PM   #11
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 52
some info on swappiness and testing data....

http://kerneltrap.org/node/3828

egag
 
Old 08-03-2005, 05:33 PM   #12
win32sux
Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
Quote:
Originally posted by xushi
As for swappiness, heh, what is that anyway? never heard of it before..
http://kerneltrap.org/node/3000

http://www.brunolinux.com/06-Fine_Tu...wappiness.html

http://gentoo-wiki.com/FAQ_Linux_Mem...2.6_kernels.29

just my ...
 
Old 08-03-2005, 09:44 PM   #13
nick_th_fury
Member
 
Registered: Jun 2003
Location: Texas
Distribution: Slackware, NetBSD
Posts: 151

Rep: Reputation: 23
Quote:
Originally posted by xushi
Hmm, no, they had up to 2.6.11.12. This laptop's running on 2.6.12.3.

As for swappiness, heh, what is that anyway? never heard of it before..

As for FF.. it might be imprefect, but i havent seen it leek memory like that before. And why doesn't my swap reduce in size when i close it ?

:'(



I've been having memory leaks from FireFox Under 2.6.11.11 for awhile now.
Usually after keeping FF up for a week or two it runs very poorly.
My swap doesn't decrease by closing FF, so I'm thinking FF isn't using it.
Dunno, but it sure seems a likely culprit to me.
 
Old 08-04-2005, 08:10 AM   #14
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 52
maybe another thing to check is the size of the cache that FF uses.
my setting ( mozilla ) is 50 MB and that's default.

egag

Last edited by egag; 08-04-2005 at 08:11 AM.
 
Old 08-04-2005, 08:21 AM   #15
xushi
Senior Member
 
Registered: Jun 2003
Location: UK
Distribution: Gentoo
Posts: 1,288

Original Poster
Rep: Reputation: 45
Quote:
Originally posted by egag
maybe another thing to check is the size of the cache that FF uses.
my setting ( mozilla ) is 50 MB and that's default.

egag
I'll set swappiness to 10 now, and restart my swap. My FF cache is 5Mb. I tried disabling it or setting it to 1k, but it was slower than what i expected.. So i set it to 5k.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Firefox Memory Leaks/Other Issues. BorderPatrol Linux - General 3 08-31-2005 01:45 PM
suse has a lot of memory leaks!!! pradeepmenon777 Suse/Novell 5 11-15-2004 03:15 AM
how to detect memory leaks abirami Linux - Networking 2 11-08-2004 06:35 AM
Mandrake 10 Community memory leaks anyone? guddler Mandriva 9 10-06-2004 02:06 AM
Memory Leaks? stampede96 Linux - Software 3 02-20-2003 01:52 PM


All times are GMT -5. The time now is 09:50 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration