Bug 10853 - Memory leak in background changing ?
Summary: Memory leak in background changing ?
Status: CLOSED FIXED
Alias: None
Product: kdesktop
Classification: Unmaintained
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Other
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2000-09-17 18:48 UTC by Unknown
Modified: 2002-09-16 14:43 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nikita V. Youshchenko 2000-09-17 18:43:36 UTC
(*** This bug was imported into bugs.kde.org ***)

Package: kdebase
Version: Sep 15 CVS

I've started KDE2 played a little and went away from my cvomputer.
When I was back after about 30 hours I found that there is no free
memory or swap. The X server process size was about 230 MBytes.

There was NO clients connected to the server expect the standard KDE2
set.

Maybe periodic desktop changes (I have set several full-screen photos)
are the source of the memory leak ?..
Comment 1 Stephan Kulow 2000-09-17 19:38:44 UTC
"Nikita V. Youshchenko" wrote:
> 
> Package: kdebase
> Version: Sep 15 CVS
> 
> I've started KDE2 played a little and went away from my cvomputer.
> When I was back after about 30 hours I found that there is no free
> memory or swap. The X server process size was about 230 MBytes.
> 
> There was NO clients connected to the server expect the standard KDE2
> set.
> 
> Maybe periodic desktop changes (I have set several full-screen photos)
> are the source of the memory leak ?..

Hmm 30 hours are hard to debug :)
We're currently debugging each app one by one for memory leaks but
haven't
found such drastic. But yes full-screen photos causing big X servers
so it
might be a possible problem.

Greetings Stephan

-- 
... but you ain't had mine
Comment 2 Nikita V. Youshchenko 2000-09-20 06:38:25 UTC
This memory leak is really caused by desktop changes.

E.g. if I change backgrounds using dcop:

dcop kdesktop KBackgroundIface setWallpaper /home/nikita/exp/multimedia/Wallpapers/7.jpg 5
dcop kdesktop KBackgroundIface setWallpaper /home/nikita/exp/multimedia/Wallpapers/6.jpg 5

After I type each of these commands X process enlarges a few megabytes.
If I repeat the commands again X process enlarges again (so it is NOT
large pixmap cache but really memory leak).
Seems that some KDE process (kdesktop?) allocates space in X for a new
pixmap but never frees it.

Seems to be a bad bug ...
Comment 3 Nikita V. Youshchenko 2000-09-21 21:17:00 UTC
I've done some debugging the problem I've reported several days ago (bug
#10853).
I added sleep(15) in several places in
KBackgroundManager::slotImageDone() in kdebase/kdesktop/bgmanager.cpp

The memory leak happens inside call to KPixmap::convertFromImage() in
line 8 of KBackgroundManager::slotImageDone(). When in this function
kdesktop enlarges X process by a few megabytes on every desktop change.

Hope this information will help to fix the bug ...
Comment 4 David Faure 2000-09-22 17:56:47 UTC
On Thu 21 Sep 2000 you wrote:
> I've done some debugging the problem I've reported several days ago (bug
> #10853).
> I added sleep(15) in several places in
> KBackgroundManager::slotImageDone() in kdebase/kdesktop/bgmanager.cpp
>
> The memory leak happens inside call to KPixmap::convertFromImage() in
> line 8 of KBackgroundManager::slotImageDone(). When in this function
> kdesktop enlarges X process by a few megabytes on every desktop change.
>
> Hope this information will help to fix the bug ...

Yes!
Thanks it helped.
I added the missing "delete pm" in this method when the pixmap
is not put in the cache.
I tested that the X server doesn't grow anymore when setting a wallpaper 
using dcop. Thanks again.

-- 
David Faure MandrakeSoft & KDE developer
Comment 5 Ralf Narozny 2001-07-31 16:37:03 UTC
Hiho hiho!

I'm using KDE2.2beta1 for a while now and I always have to restart my 
kdm again for it allocates memory with every change of desktop. I'm 
experiencing this behavior on 2 machines with 2 different versions of 
SuSE Linux

Pentium 800 MHz Kernel 2.2.19 & 2.4.4-4GB and
Athlon Thunderbird 800 MHz Kernel 2.4.4-4GB

I don't know which information else you might need.

Greetings
 Ralf
Comment 6 uz 2001-09-06 15:50:04 UTC
I have the same effect here on a RedHat 7.1 system with KDE 2.2 even if I
don't use background photos (just a color gradient). I'm using six desktops
and after switching through all six and back to the first one the size of the
X server has increased by between 10 and 20 Megabytes(!). The following two
lines are from the output of "ps auxw" and only a few seconds apart (one cycle
through all desktops):

root     20956  7.1 32.0 218300 164272 ?     S    17:30   0:44 /etc/X11/X -auth /var/lib/kdm/authfiles/A:0-EesCvd
root     20956  7.4 34.2 229868 175844 ?     S    17:30   0:47 /etc/X11/X -auth /var/lib/kdm/authfiles/A:0-EesCvd

XFree version is 4.0.3 I'm using the standard XFree NVidia drivers (*not* the
binary only drivers with 3D acceleration from Nvidia corporation). I've also
tried the Nvidia drivers same effect.

Killing any KDE processes does not help restarting the X server every few
hours will "fix" it. The problem is gone when choosing a solid color for the
background.

The behaviour is new with KDE 2.2.

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz@musoftware.de
Comment 7 Marc Loiselle 2001-09-09 17:40:55 UTC
I am seeing this problem with 2.2 with XFree86 4.1.0 NVidia.  I can't 
use backgrounds at all because of this bug.  Even using Single 
Background causes the leak if you switch the background.  Very annoying. 
 Leak is 3076K everytime the background is changed.  Please fix this.
Comment 8 Bryan C. Warnock 2001-12-08 14:35:40 UTC
Behavior (re)appears in KDE 2.2.2.   
(XFree86 4.1.0 i128 driver 1600x1024d16)

Prevalent when running KDE-provided xearth or kworldwatch as a background 
program via Control Center->LookNFeel->Background.

About 24 hours to fill 900MB of virtual memory.  (No other programs running 
5 minute cycle.)

-- 
Bryan C. Warnock
bwarnock@capita.com
Comment 9 vsauer 2002-02-17 22:35:11 UTC
Hi

behavior appears in:

KDE 2.2.2
XFree-4.2.0
mga-driver G400
DualHead Xinerama 2304*864

on SuSE 7.3

SuSE claims the bug to be in the Render Extension of X and to be fixed 
in XFRee-4.2.0 which I updated to. This is not the case.

After 8 hours:
 > 300 MB
(normal usage of 6 Desktops including xvideo and v4l)

After 20 hours with heavy use
 > 500 MB (ca. 200MB went into swap)

What can I do against it?
I have enough RAM to tolerate it but I don't like the situation.
-- 
8<------------------------------------------------------------
   Volker Sauer  *  Alexanderstrasse 39/217  *  64283 Darmstadt
   Telefon: 06151-154260  *  Mobil: 0179-6901475 * ICQ#98164307
   mailto:volker@volker-sauer.de  *  http://www.volker-sauer.de
Comment 10 vsauer 2002-02-18 20:40:03 UTC
I tested a little bit.
Everytime I change the background using dcop kdesktop .... (2304x864 
JPEG File over Dualheadscreen) the X-Server grows about 15MB.
I switched of the Pixmap-Buffer switch which was before 2048k (I don't 
exactly know what this switch means). It didn't help.

This is my X after 135 hours. About 8 hours it was just standing 
around. The rest I ran xawdecode (grabdisplay) mozilla konquerer licq 
and tested around desktop-switching (20x) and background-switching (10x).

  1369 root       9   0  406M 374M  3168 S     0  1.6 37.2  30:09 
/usr/X11R6/bin/X

Is there a workaround?
Can I replace any binary or library by an older version or by a newwer 
version?
I'm not going to compile my own KDE.
-- 
8<------------------------------------------------------------
   Volker Sauer  *  Alexanderstrasse 39/217  *  64283 Darmstadt
   Telefon: 06151-154260  *  Mobil: 0179-6901475 * ICQ#98164307
   mailto:volker@volker-sauer.de  *  http://www.volker-sauer.de
Comment 11 Stephan Kulow 2002-02-18 20:56:11 UTC
On Montag 18. Februar 2002 21:40 Volker Sauer wrote:
> I tested a little bit.
> Everytime I change the background using dcop kdesktop .... (2304x864
> JPEG File over Dualheadscreen) the X-Server grows about 15MB.
> I switched of the Pixmap-Buffer switch which was before 2048k (I don't
> exactly know what this switch means). It didn't help.
>
> This is my X after 135 hours. About 8 hours it was just standing
> around. The rest I ran xawdecode (grabdisplay) mozilla konquerer licq
> and tested around desktop-switching (20x) and background-switching (10x).
>
>   1369 root       9   0  406M 374M  3168 S     0  1.6 37.2  30:09
> /usr/X11R6/bin/X
>
> Is there a workaround?
> Can I replace any binary or library by an older version or by a newwer
> version?
> I'm not going to compile my own KDE.

You didn't mention the X version. I had this problem with X 4.0 but it went 
away with X 4.1

Greetings Stephan
Comment 12 Edwin Glaser 2002-02-22 22:40:48 UTC
Hello

I have the same annoying leak with

suse 7.3
X 4.1.0
kde 2.2.1 and kde 2.2.2
nvidia card bundled nv driver and the driver from nvidia.com.

I didn't have this problem with an old ati card.

Every time I change the background color X grows up by 5M.
Xearth as 'Background Program' causes 5M every 10 minutes.
Since I'm using xearth for years I'm quite sure my previous
card an ati card and did'n have such a huge memory leak.
Unfortunatly I can't verify it - the ati card is broken.

Ok it's possible to live without xearth but I realy like it!

Hope it helps Edwin.

-- 
Edwin Glaser -- edwin@pannenleiter.de
Comment 13 Volker Sauer 2002-02-24 21:15:00 UTC

-------- Original Message --------
Subject: Re: 10853
Date: Sun 24 Feb 2002 19:14:36 +0100
From: Volker Sauer <volker@volker-sauer.de>
To: Stephan Kulow <coolo@kde.org>
References: <3C74D033.1040505@rbg.informatik.tu-darmstadt.de> 
<200202211226.46651@master.kde.org> <3C751E12.4040501@volker-sauer.de> 
<200202211725.54060@master.kde.org>

Hi Stephan

I switched of this smoothing-feature for the desktopicons (in german
it's called alpha-channel-blending or so). Now the leak produced by the
background-changes is definitly gone (Maybe it's caused by the rendering
feature of X like suse supposed).
The X server is still using a lot of memory - especially when using lots
of windows. e.g. it uses about 50M after login and grows usually to 85M
when using some windows. when i use many gimp-windows or lot's of
konquerer windows (30 to 50 windows) it can go up tp 200M. when I close
the windows it keeps allocationg 200M (I doesn't grow without doing
anything like before).
Is this behavior normal? Other people told me that their X-server only
consumes 25M after 3 day usage (after which there should have been quite
a lot of windows). Sould the X server free the memory consumed by so
many windows after closing them?

BTW: I switched to kernel 2.4.16-Suse-4GB because somebody told me that
this would definitly be the problem (njjaa not really). And I'm using
the matrox driver 1.4.3.
KDE is still 2.2.2 and X ist 4.2.0


Stephan Kulow wrote:
 > On Donnerstag 21. Februar 2002 17:19 you wrote:
 >
 >>Hi
 >>
 >>i ran gnome the last 5 hours and startet xearth. The xserver grew up to
 >>110MB - which I think is ok for a Duah-Head-System - and stayed at thid
 >>value.
 >>Maybe xearth does't cause the memory leak or gnome doesn't cause it.
 >>
 >>Somebody told me that he had the problem. As he changed the kernel from
 >>2.4.10 to 2.4.16 it disappeared.
 >>
 >>That's what my mga-diver looks like:
 >>
 >>(II) Loading /usr/X11R6/lib/modules/drivers/mga_drv.o
 >>(II) Module mga: vendor="The XFree86 Project"
 >>          compiled for 4.2.0 module version = 1.1.0
 >>          Module class: XFree86 Video Driver
 >>          ABI class: XFree86 Video Driver version 0.5
 >>
 >>It's the one provided by XFree-4.2.0.
 >>
 >>I can't see which version exactly is yours.
 >>
 >>Is it from XFree4.1.0 or
 >>from the matrox website?
 >>
 >>
 > Mine says 1.1.0 too and I think it's from XFree 4.1 but as I said I 
haven't
 > compiled it but is from the Caldera RPM.
 >
 > Greetings Stephan
 >
 >



-- 
8<------------------------------------------------------------
    Volker Sauer  *  Alexanderstrasse 39/217  *  64283 Darmstadt
    Telefon: 06151-154260  *  Mobil: 0179-6901475 * ICQ#98164307
    mailto:volker@volker-sauer.de  *  http://www.volker-sauer.de


-- 
8<------------------------------------------------------------
   Volker Sauer  *  Alexanderstrasse 39/217  *  64283 Darmstadt
   Telefon: 06151-154260  *  Mobil: 0179-6901475 * ICQ#98164307
   mailto:volker@volker-sauer.de  *  http://www.volker-sauer.de