Memory Leak


Forum: HD Install
Topic: Memory Leak
started by: Juanito

Posted by Juanito on Nov. 27 2007,15:43
My old desktop with a frugal toram hd installation has been up for 36 days now (since the last power cut).

Torsmo shows the following:

RAM Usage: 426M/503M - 84%
Swap Used: 133M/965M - 13%
File systems:
/ 2.3/2.9M
/home 361M/393M

I'm curious as to why the ram usage is so high - the machine is acting as a file, printer, scanner, music server but the extensions loaded are all uci.

I've checked all the obvious places for large files - /var, /tmp, /home/dsl but don't see anything unusual. The ram usage is creeping up each day - is there some command I can use to try and track down the cause of this?

Posted by roberts on Nov. 27 2007,16:19
If you are using fluxbox, then that's your answer.
It has been posted and verified many times in the past.
It is one reason that I switched to jwm as the default, yet still resulting much protest.

Posted by roberts on Nov. 27 2007,16:26
Here is the old < thread. >

Usually this is not a problem except when running a server.
But then I usually run servers without X.

You could try an update and use one of the new Xvesa drivers in testing and see if the interaction with flubox makes a difference.

Posted by Juanito on Nov. 27 2007,17:10
Thanks - I'd not thought to search on "memory AND leak", never having seen anything of that nature in this forum - and I also had  a sneaking suspicion that several of my daughters 75M print files were stuck in the samba spooler somewhere...

I've restarted fluxbox using Xvesa.tar.gz from testing, the ram usage is down to 58.0M/503M - 11% - let's see

Posted by curaga on Nov. 27 2007,17:12
Juanito, congrats for your 1K :D
Posted by john.martzouco on Nov. 27 2007,21:01
Quote (roberts @ Nov. 27 2007,11:19)
It is one reason that I switched to jwm as the default, yet still resulting much protest.

Hi Robert,

I wasn't aware that there are technical issues with Fluxbox.  That's very sad because it is the nicer of the two WMs available.

I don't like JWM very much either.  My reasons are very superficial.  I find it's presentation to be a poor copy of the classic Windows desktop (a desktop that I actually like very much).

Fluxbox has a more sophisticated appearance with it's softly gradated captions.  JWM is dressed up in very crude gray boxes.

I also dislike the mini icons next to all of the commands.  There's something about them that doesn't suit my taste.

I also very much like that double-clicking the caption bar in FB shades the window.  This is a new feature for a guy from the Windows world, but it's sooooo much more intelligent than minimizing to a taskbar.

I know that most of these reasons are cosmetic and that someday I may find the time to dress and undress JWM to my liking, but until then I'll stick to the more refined looking FB and keep my eyes open for this memory leak problem.

Regards,
John

Posted by john.martzouco on Nov. 27 2007,21:02
Quote (curaga @ Nov. 27 2007,12:12)
Juanito, congrats for your 1K :D

and curaga... congrats on your 1111 !

Posted by roberts on Nov. 28 2007,01:19
Window Manager features are very subjective.

Personally I don't use either fluxbox or jwm. For me fluxbox is heavy. I prefer more minimal window managers. And I have tried to open the process in 4.x  to allow easier use of the other window managers

I just find it interesting that one that has a memory leak is perfered over one that happens to look and feel like windows. But so too, is the Windows look and feel for dfm.  Dfm and jwm at least provide the new user a more familiar environment. That was my goal for 4.x.

I have personally seen new users struggle with fluxbox when they have accidentally minimized a window or try to use the pager. Most don't how to use the tabbing capability. Like Windows or not, the UI is the most familiar.

And then every so often DSL get a "black eye" when the memory leak is revisited and we have this discussion again.

Posted by john.martzouco on Nov. 28 2007,04:20
Robert,

Any chance you could share your minimal WM with me?  I'd like to give it a go.  Having a third metaphor to speak with would be helpful.  I have a very high regard for the work that you're doing and expect that you are guiding us all in the right direction... please accept me apologies for resisting.

I'm not sure what to say about the FB / JWM debate... coming from 15 years on a Windows box *should* endear me to JWM, I agree... but the functionality that I'm seeing in FB surpasses anything the MS model offers.  Like the QWERTY keyboard, and the Linux OS, majority familiarity doesn't reflect the true value of a product, only it's market / mind share.  If value beat out popularity we'd all be using Dvorak keyboard layouts and Microsoft wouldn't be an empire today.

I truly believe that a Start button on FB would take away the confusion for most Windows converts.  Let's remember that the people who are interested in Linux are drawn to it because it *is not* Windows.  Why would anyone be tempted to leave one functioning OS for another if they superficially and immediately offer exactly the same things?... better the devil you know than the devil you don't.

I've been using Fluxbox since my first introductions to DSL two months ago.  I tried to switch over to JWM, but already the advantages that I've learned to enjoy in FB make it impossible for me to do so.  The default 'shading' on double-click, the clean appearance of the bottom margin and the svelt font and smooth gradations of color make me much more comfortable than what is shipped today in JWM.  If I could get to liking JWM, I might be tempted to dress it up, but I reiterate that right now, it looks like a very poor clone of a Windows classic desktop.  As a recent convert from the Windows camp, I can tell you first-hand that an ugly version of Windows is not an enticing reason to continue using DSL.

I read through to halfway chapter 4 in the Official DSL Book tonight and only just learned about tabbing the FB windows... now there's absolutely no way that I'll ever go back to an under-developed feeling window manager.

I can accept a memory leak under the conditions that I use my computer.  I don't expect that DSL or Linux in general can offer me a Hibernate mode so my machines will be cycled off and on every 18 hours because we don't run them unattended (we almost had a house fire from a motherboard that short-circuited).  How much memory can escape in 18 hours of surfing the net and building web pages?

Have the merits of JWM been listed anywhere I can look at them... I can still be convinced if I see advantages.

I bet I'm totally off-base posting this in this section of the forum... I'll gladly move it to another thread if there's an active debate happening on the subject.

With the greatest respect,
john

Posted by curaga on Nov. 28 2007,07:30
Thanks John :)

There are many window managers in MyDSL, you might want to give a try to each of them; I personally like Xfce from the heavier desktops, fluxbox on DSL, and for my next OS, it's so going to be Enlightenment 17 (take a look at < Elive's propaganda video > (36mb))

Posted by john.martzouco on Nov. 28 2007,11:49
I should have been aware of that curaga, thanks.  I've already downloaded all the WMs from myDSL, I'll put them on my todo list.
Posted by Juanito on Nov. 30 2007,04:41
Well, that's two days now and the memory use with fluxbox and XVesa.tar.gz has not changed at all:
Code Sample
$watch -n 60 pmap 11707 | grep -w total
total    16904K
total    16904K
...
total    16904K

- so maybe the problem is cured in the kdrive from Xfree-4.6...

Edit: spoke too soon, now after surfing the web for a while, opening some new tabs in firefox, etc the memory leak has started up again.

Posted by WDef on Nov. 30 2007,16:34
I have had occasions where ram use has maxed unexpectedly (fluxbox + xvesa) - I'd never read about this memory leak issue, so now I know.

Quote
JWM is dressed up in very crude gray boxes.


I agree that jwm has a spidery look, which is a real pity.  Is there a way of improving this I wonder?  Would dfferent gtk+ theming make any difference, or has that got nothing to do with it?

Posted by lucky13 on Dec. 01 2007,00:21
john.martzouco:
Quote
JWM is dressed up in very crude gray boxes. I also dislike the mini icons next to all of the commands....I also very much like that double-clicking the caption bar in FB shades the window.  This is a new feature for a guy from the Windows world, but it's sooooo much more intelligent than minimizing to a taskbar.

The colors can be adjusted to suit your tastes in .jwmrc, and you can remove the icon tags there as well if you don't want icons. Most of the color settings can be gradients (two colors separated by a colon); the menu and text colors are one color. JWM also allows shading of windows by scrolling your mouse over the window title bar or via keystroke (the default config uses alt-F2 for window menu options; you can configure in your own keystrokes as well -- I use Ctrl-s to shade/unshade).

I disagree that Windows users don't want a similar interface when they switch to Linux. One of the reasons Linux has been able to win over Windows users is because the most common interfaces -- Gnome, KDE -- are very Windows-like. JWM, IceWM, etc., work on common principles that are intuitive for most people: one button for a menu, a taskbar to show what's running and iconified applications, and maybe a clock. Familiarity causes people to say, "I understand this." Less familiarity means (sometimes) more learning curve, and that's beyond the comfort zone of most people.

WDef:
Quote
Would dfferent gtk+ theming make any difference, or has that got nothing to do with it?

I don't think that matters as much as color selection. I've played around with configuring JWM the last couple weeks (trying to make it more keyboard-friendly before going back to ratpoison on my laptop and hacking a lua-console menu system) and find that it looks better the more contrast there is between gradient colors where they're allowed (which is everywhere except the default menu background). I last had JWM looking kind of like the blueglass theme for fluxbox with a cyan/grey gradient and white letters for active over a medium grey menu background and black letters on the menu.

Posted by roberts on Dec. 01 2007,06:48
Quote (Juanito @ Nov. 29 2007,20:41)
Well, that's two days now and the memory use with fluxbox and XVesa.tar.gz has not changed at all:
Code Sample
$watch -n 60 pmap 11707 | grep -w total
total    16904K
total    16904K
...
total    16904K

- so maybe the problem is cured in the kdrive from Xfree-4.6...

Edit: spoke too soon, now after surfing the web for a while, opening some new tabs in firefox, etc the memory leak has started up again.

That is not good news. So it appears that fluxbox, even newer ones, and Xvesa, even with a newer version, the issue of a memory leak remains.

Come to think of it, I can't recall any other distribution that is using both fluxbox and Xvesa. Too me, this is a show stopper. I am inclined to remove something that would cause a system failure and therefore possible data loss.

Posted by Juanito on Dec. 01 2007,08:12
Quote
That is not good news. So it appears that fluxbox, even newer ones, and Xvesa, even with a newer version, the issue of a memory leak remains.

- Perhaps first we could have a look at which versions of fluxbox and k-drive I could try out. At present I am using the version of fluxbox that comes with dsl-3.4.2 and the k-drive from xfree-4.6 Are there more up to date versions that I could try out that make sense in the context of dsl?

Quote
Too me, this is a show stopper. I am inclined to remove something that would cause a system failure and therefore possible data loss.

- I take your point, but on the other hand I only noticed for this for the first time a few days ago after using dsl for 2.5 years and after 38d uptime. At the moment, the memory leak has stopped again (at 40,686k) - I wonder if firefox is somehow involved in this?

Posted by john.martzouco on Dec. 01 2007,08:57
Quote (lucky13 @ Nov. 30 2007,19:21)
WDef:
Quote
Would dfferent gtk+ theming make any difference, or has that got nothing to do with it?

I last had JWM looking kind of like the blueglass theme for fluxbox with a cyan/grey gradient and white letters for active over a medium grey menu background and black letters on the menu.

OT:
Hi lucky13,

I mentioned in the < icon look and feel thread > that you've been playing with BlueGlass for JWM.

Posted by curaga on Dec. 01 2007,09:48
There's Xfree 4.7.0; And Xorg has improved the Kdrive servers even more. Though they only mention screen & input hotplugging in 7.3, I'm sure they have fixed other things too.. Just not sure if this is something X can fix, if it's a fluxbox/firefox bug..

There's fluxbox 0.9.14 in the uci section..

Posted by Juanito on Dec. 01 2007,13:19
Quote
Just not sure if this is something X can fix, if it's a fluxbox/firefox bug..

- I'm trying things now with opera rather than firefox - no leak so far...

Posted by roberts on Dec. 01 2007,14:27
The version of fluxbox in DSL is very old. But it has stayed because  of its size versus functionality. There have indeed been posts about firefox instantly closing. Normally we just answer "you ran out of memory", when it could be the memory leak issue. I know many in the community like fluxbox. It is just my high standards that are currently in the way. It is something that I cannot go in and fix the code. I will let the community try a few more things before any decision is made.
Posted by curaga on Dec. 01 2007,17:57
The leak could as well be in FF - or in both.
Posted by curaga on Dec. 01 2007,18:32
For the original question, how to find the leak - Valgrind's memcheck is good for that.
But I just checked Fluxbox's changelog; when I searched for "leak", there were about ten after 0.1.10 (which I think is in DSL; edit, I looked from "packages", which is out of date..)

Posted by roberts on Dec. 01 2007,19:24
It is v0.1.14 from fluxbox -version
Posted by roberts on Dec. 01 2007,20:01
From the old posted thread, the only way to avoid this is by using the XFree86 extension and Fluxbox. Since XFree86 is an extension then I would be leaning towards moving Fluxbox to an extension as well, with a warning in it's info file that it depends on XFree86. This would only be considered for current on-going development version 4.x.

Perhaps someone want to test this with the Xorg extension.

Again, I have not see the leak with many other window managers including the current 4.x default of jwm.

Posted by Juanito on Dec. 02 2007,10:36
I've just been trying out XFree86, fluxbox and firefox on my laptop - note that this is using the i810 driver rather than Xvesa so I'm not sure how relevant this is...

Over about 5 hours the memory used by XFree86 varied up and down but the overall trend is definately up - from about 156,000k to 168,000k (not sure why the numbers are so big - maybe I'm making a mistake somewhere).

Posted by WDef on Dec. 02 2007,17:31
Juanito, wondering if you have tried setting a cap set on FF's use of memory with browser.cache.memory.capacity in about:config?  It has a habit of growing in an uncontrolled way.

< http://damnsmalllinux.org/cgi-bin....+memory >

Posted by Juanito on Dec. 02 2007,17:56
I think I proved to myself there's no issue with opera, so back to firefox.

I created browser.cache.memory.capacity and set it to 16384 - let's see after a few days.

Posted by Juanito on Dec. 06 2007,14:48
@WDef

You might be on to something here, 3 days later the memory used by XVesa seems to have stablised around 16M more than when I set browser.cache.memory.capacity

Posted by WDef on Dec. 06 2007,19:25
Maybe try reducing that cap more - I have it set to 8MB at the moment and I have 512MB ram.  Low ram machines might go lower still.
Posted by Juanito on Dec. 07 2007,08:57
Reducing the cap did not have an effect on the amount of memory used by Xvesa (should it?) without re-starting firefox.

To try something different I loaded up xorg72 and finally got it to work with my MGA 2164W [Millennium II] AGP graphics card (4,096KB video memory) and Dell 1905FP monitor at 1280x1024x16 - lucky13's dinasaur looks great...

Here's where I am so far:
Code Sample
[Starting mem use for X in xorg72.uci]

$ watch -n 60 pmap 10832 | grep -w total
total    26924K
total    27268K [start firefox 4 tabs browser.cache.memory.capacity not set]
total    32804K [45d 18h 57m]
total    41208K [45d 21h 56m]
total    41772K [45d 22h 59m]
total    36608K [set browser.cache.memory.capacity 16384]
total    38108K [46d 01h 58m]
total    85696K [46d 16h 53m]
total    85708K [set browser.cache.memory.capacity 8192 - no effect]
total    39204K [close firefox]`
total    39204K
total    39204K
total    39396K [start firefox browser.cache.memory.capacity 8192 still set]
total    39396K [46d 17h 16m]
total    39396K [open 2nd tab]
total    39396K
total    39424K
total    39396K
total    39396K [open 3rd tab]
total    39396K
total    39396K [open 4th tab]
total    39396K
total    39628K [46d 17h 43m]
total    39628K [46d 18h 30m]
total    41820K [47d 00h 09m]
total    50188K
total    80876K [jumped 30M in one minute..]
total    80984K [47d 02h 03m]

It seems as though the memory leak did not occur when the machine was left alone with Xorg but the memory used increased by 20M in 21h without even touching the machine with the Xvesa k-drive. When I surfed the web, opened graphics files etc, the ram usage increased - by 30MB in one minute in one case with Xorg. Note that the readings above are shown after closing any additional windows opened.

So far it looks like fluxbox, firefox and either Xvesa, XFree86 or Xorg have the same sort of problem - and setting browser.cache.memory.capacity does not seem to stop it.

Posted by Juanito on Dec. 09 2007,14:16
I tried a similar test with jwm, firefox and Xvesa from the base dsl using dsl-3.4.2:
Code Sample
$ watch -n 60 pmap 15676 | grep -w total
total    14460K [00d 22h 30m]
total    20600K [open firefox 4 tabs browser.cache.memory.capacity 8192]
total    20584K [00d 22h 36m]
total    21532K [00d 23h 12m]
total    21764K [00d 23h 27m]

If I don't touch the machine, I can sit and watch the memory used click up by 4 or 8KB most minutes (I assume the "60" in the watch command is 60s).

Am I missing something here?

Posted by roberts on Dec. 09 2007,17:03
The original tests (old thread) did not include Firefox.
Posted by Juanito on Dec. 10 2007,03:23
Somehow I missed that...

Closing firefox stopped the memory leak with jwm straight away. I restarted with fluxbox - running "top" in one window and running the "watch" command on Xvesa in another - left it running overnight and there was no leak without firefox.

This last part seems to contradict the original thread and points to firefox as being the cause of the problem with both fluxbox and jwm.

Posted by roberts on Dec. 10 2007,22:12
With all the internal changes to DSL over the last two years, the question remains, "Can the test of Dec 2005" be reproduced?

To be fair, one would have to use DSL v3.4.x and boot with with base, norestore, and legacy options. Then proceed as was posted back on 12/13/2005, i.e., top and three xterms containing the "watch".

Posted by chaostic on June 25 2008,05:38
Edit: Err. Ignore this. I just read it back and it sounds a bit daffy even to me...
Edit: Aside from daffy, it doesn't work either. My xvesa usage doubled again in 24 hours, even without having launched xmms from inside of fluxbox.

Bringing this back up because I have a bit of insight in what may be part of the leak (DSL 3.4.11, fluxbox, xvesa, 6 and a half days uptime). Within about 3 hours, my xvesa jumped from 13mb to 30mb, going up 4kb per second when I noticed it. Only x app I was running was xmms. When I killed xmms, the xvesa memory usage went down .5mb. I have since started xmms again, but from a ssh session (I set the DISPLAY variable).

Anyway, the insight is, could it be that the memory leak is caused in xvesa only when a program is launched from fluxbox?

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.