Bug 341927

Summary: Memory leak in Choqok
Product: [Applications] choqok Reporter: Eugene Shalygin <eugene.shalygin+bugzilla.kde>
Component: generalAssignee: Mehrdad Momeny <mehrdad.momeny>
Status: REPORTED ---    
Severity: normal CC: scarpino
Priority: NOR    
Version: Git   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In: 1.5
Sentry Crash Report:

Description Eugene Shalygin 2014-12-15 18:42:30 UTC
Choqok has a memory leak. After a few hours its memory footprint doubles, overnight it reaches 2GB (with initial value of ~500MB) and grows further. This happens also with all the plugins disabled. Unfortunantely, Valgrind crashes when I attempt to run choqok with it.
Perhaps the following is related: with kDebug() call in TimelineWidget::removeOldPosts() uncommented, this message was not spotted in the debug output

Reproducible: Always
Comment 1 Andrea Scarpino 2014-12-15 20:22:20 UTC
Probably a duplicate of #271858
Comment 2 Mehrdad Momeny 2014-12-16 09:14:45 UTC
Did you leave choqok running and updating over night?
or you were using it, I mean, marking tweets as read and they removed from the timeline?

Because as number of PostWidgets in the gui increase, the memory usage increase too.
And this was the case in bug 271858.
But if after remove/hiding PostWidgets from GUI, the memory doesn't change and still increases, that's a new bug.
Comment 3 Eugene Shalygin 2014-12-16 12:44:48 UTC
It is a normal use: timeline is read. After I found TimelineWidget::removeOldPosts() that must be called at minimise, I tried minimising Choqok window, but this does not change the memory footprint.
Comment 4 Eugene Shalygin 2014-12-16 17:11:42 UTC
Just to be specific here are the numbers: timeline contains 871 unread tweets, memory footrpint 3122448 kB, "Mark all as read", "File/Minimize". Choqok shows some CPU activity, but the footprint does not change. After wait for some new tweets (7), and restoring the Choqok window with a second timeline, without new tweets active, footprint is the same. Now I switch to the timeline with the new tweets and the footprint grows to 3136320 kB
Comment 5 Eugene Shalygin 2014-12-16 22:50:31 UTC
I've traced one(?) of the sources. This is MediaManager::fetchImage().  It leaks QPixmap inside of the function, and its returned values are not freed anywhere also. Now testing a patch.
Comment 6 Andrea Scarpino 2014-12-17 13:48:42 UTC
Git commit 5096b5e9b7b223172d81b4d01ed04f3035c4a45f by Andrea Scarpino, on behalf of Eugene Shalygin.
Committed on 17/12/2014 at 13:47.
Pushed by scarpino into branch 'master'.

Fix memleaks in images fetching

REVIEW: 121576
Related: bug 271858
FIXED-IN: 1.5

M  +3    -3    helperlibs/twitterapihelper/twitterapiwhoiswidget.cpp
M  +7    -9    libchoqok/mediamanager.cpp
M  +6    -6    libchoqok/mediamanager.h
M  +12   -13   libchoqok/ui/postwidget.cpp
M  +3    -3    plugins/betternotify/notification.cpp

http://commits.kde.org/choqok/5096b5e9b7b223172d81b4d01ed04f3035c4a45f
Comment 7 Eugene Shalygin 2014-12-18 08:20:13 UTC
Memory footprint increases but it does it slower than before
Comment 8 Justin Zobel 2021-03-09 01:26:58 UTC
Thank you for the bug report.

As this report hasn't seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists.

If this bug is no longer persisting or relevant please change the status to resolved.