Bug 71975

Summary: Kopete leaked 2400 MB or RAM overnight, but didn't ceash.
Product: [Unmaintained] kopete Reporter: Andrew Somerville <landrews>
Component: generalAssignee: Kopete Developers <kopete-bugs-null>
Status: RESOLVED NOT A BUG    
Severity: normal CC: bastian, chris.rs, ipv4
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Andrew Somerville 2004-01-06 13:57:23 UTC
Version:           Newest (using KDE Devel)
Installed from:    Compiled sources

I left kopete running when I went to bed. When I got up, my system could hardly move. It took me 10min to get top up, and see that kopete had filled my 512MB or ram, and 2GB of swap. I killed it, and things returned to normal. No idea why this happens.

Have fun.
Comment 1 Andy Goossens 2004-01-06 16:12:20 UTC
"Version: Newest" -> There is no such version :-p

Do you use Kopete 0.7.4, a Kopete beta or CVS (and so from which date)?
Comment 2 Andrew Somerville 2004-01-06 19:22:50 UTC
0.7.94 (CVS >= 20031206)

Is that enough info?
Comment 3 Martijn Klingens 2004-01-06 19:44:24 UTC
*** Bug 71998 has been marked as a duplicate of this bug. ***
Comment 4 Martijn Klingens 2004-01-06 20:57:20 UTC
*** Bug 72005 has been marked as a duplicate of this bug. ***
Comment 5 Thomas Kjosmoen 2004-01-07 08:33:35 UTC
I can confirm this problem too. I have tried to disable/enable pretty much everything without any change, and it leaks with ALL plugins disabled too. (Although, I cannot disable the AIM protocol plugin for some reason.)
If I just start Kopete, it doesn't leak anything, but once I open a chat-window it starts leaking at a rate of about 4MB/min. I wish I could provide some more constructive information.
Comment 6 Sami Nieminen 2004-01-07 09:12:08 UTC
What version of QT you are using? I experienced huge leaks with QT 3.3.0-beta1 that seem to be gone away with a downgrade to 3.2. The following bug reports contain info of my problems:

http://bugs.kde.org/show_bug.cgi?id=62669
http://bugs.kde.org/show_bug.cgi?id=71611
Comment 7 Thomas Kjosmoen 2004-01-07 09:33:51 UTC
I'm using QT version "3.3.0-snapshot-20031220"
I reckon I can safely downgrade to 3.2 without braking anything?
Comment 8 Sami Nieminen 2004-01-07 09:43:34 UTC
When downgrading QT, you need to recompile all of the kde, unfortunately.
Comment 9 Andrew Somerville 2004-01-07 11:24:58 UTC
I'd like to see the code. I wonder if there is a lot of pointer manipulation going on. That's pretty error prone. (I'm assuming since you say that downgrading QT helps that things are done in a fairly modern way.)
Comment 10 Andrew Somerville 2004-01-07 11:27:51 UTC
Or at least that is not an issue of pointers.
Comment 11 Martijn Klingens 2004-01-07 12:37:51 UTC
Subject: Re: [Kopete-devel]  Kopete leaked 2400 MB or RAM overnight, but didn't ceash.

On Wednesday 07 January 2004 11:24, Andrew Somerville wrote:
> I'd like to see the code. I wonder if there is a lot of pointer manipulation
> going on. That's pretty error prone. (I'm assuming since you say that
> downgrading QT helps that things are done in a fairly modern way.)

It is a problem with QMovie. If you comment out the loadMovie call in Kopete's 
chat window (as I said in reply to Sami's bug report) the leak is gone.

The source code of Qt (where QMovie is) is readily available on several 
locations, or use qt-copy from KDE CVS. Note that my latest changes to 
unpause/pause the movie when it's not being shown alleviate the effect at 
least on my Qt 3.2, so you may need to comment out those calls for better 
troubleshooting.

Also note that Qt 3.2 never leaks beyond the pixmap cache limit, which is 
about 3 Mb, whereas Qt 3.3 reportedly leaks much beyond that.

Comment 12 Helio Chissini de Castro 2004-01-09 20:24:15 UTC
I confirm with qt-copy 3.3.0
Happens when dialog in chat mode is open.
A constant leak in about 200 k.
Comment 13 Martijn Klingens 2004-01-09 23:15:58 UTC
Subject: Re: [Kopete-devel]  Kopete leaked 2400 MB or RAM overnight, but didn't ceash.

On Friday 09 January 2004 20:24, Helio Chissini de Castro wrote:
> I confirm with qt-copy 3.3.0
> Happens when dialog in chat mode is open.
> A constant leak in about 200 k.

Well, what can we do about it? It's a problem in QMovie, I can't help you with 
that.

Should we disable the movie altogether???

Comment 14 Jason Keirstead 2004-01-09 23:31:20 UTC
Maybe we should? Or replace it with a simple blink or something?

It's not like the animation is a requirement, not all protocols even take advantage of it (or can).

And if it is causing large memory leaks (or even small ones) ?

Even a 3 MB leak under QT 3.2 is quite large IMO.
Comment 15 Martijn Klingens 2004-01-10 00:05:04 UTC
On Friday 09 January 2004 23:31, Jason Keirstead wrote:
> Even a 3 MB leak under QT 3.2 is quite large IMO.

That's not a leak, that's just Qt's pixmap cache. The worst it does is pushing other entries out of the cache, or make the cache grown to 3 Mb when it would otherwise stay smaller.

But that part is not cumulative, there's only one cache, so no matter how many windows you open the size is the same. Also note that due to my pause()/unpause() workaround the cache filling only happens for the duration of the playing animation, which is pretty short. You need to send a lot of messages to hit the three Mb.

Apparently it's much worse for Qt 3.3 though, but I don't have that version here, so I can't check.

Waldo, you investigated the QMovie leaks on Qt 3.2, do you have any idea why it's so much worse in 3.3?

-- 
Martijn
Comment 16 Jason Keirstead 2004-01-12 20:49:53 UTC
*** Bug 72507 has been marked as a duplicate of this bug. ***
Comment 17 Martijn Klingens 2004-01-17 20:35:42 UTC
Maksim Orlovich and Antonio Larossa tried to track down this problem for me on IRC today. It seems to be a Qt bug that happens only in *some* Qt 3.3 snapshots, and since Qt 3.3 is not officially released yet Coolo advised me to consider this *NOT* a showstopper for KDE 3.2.

It's a Qt bug, and only if it occurs with an official release we should consider adding a workaround to Kopete.

Until then I'll close the bug, confident that the fixes that are apparently in recent snapshots (according to Maksim there are some MNG-related cleanups in the code now...) will make the release.

Martijn