Review Request: Kinda fixes "memory leak" caused by comic plasmoid

Matthias Fuchs mat69 at gmx.net
Thu Apr 7 17:25:05 CEST 2011



> On April 7, 2011, 2:43 p.m., Aaron J. Seigo wrote:
> > applets/comic/comic.cpp, line 376
> > <http://git.reviewboard.kde.org/r/101046/diff/1/?file=13903#file13903line376>
> >
> >     why only on non-error?
> >     
> >     also, this should happen after accessing the values of data as it could (in theory, strictly by the API docs) result in data becoming unset.

The initial idea was to send the data if there is no error anymore. E.g. there is no internet connection, thus the data engine reports an error. Now if there happens to be an internet connection the data engine automatically trys again and then sets the data. As the applet is still connected it would then get the comic.

The disadvantage of this approach is that I do not specify which type of error happened in the datasource. Thus it might very well be that it will be never taken care of.


> On April 7, 2011, 2:43 p.m., Aaron J. Seigo wrote:
> > applets/comic/comic.cpp, lines 463-467
> > <http://git.reviewboard.kde.org/r/101046/diff/1/?file=13903#file13903line463>
> >
> >     this should be doable without a separate QObject? simply connect the source to the ComicApplet as it was, then in dataUpdated do:
> >     
> >     if ( source != mOldSource ) {
> >         disconnectSource( source );
> >         return;
> >     }
> >     
> >     that should have the same affect, looking at the code?

Yes. I thought it to be nicer that way but as you said it is not needed.


- Matthias


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/101046/#review2457
-----------------------------------------------------------


On April 7, 2011, 2:08 p.m., Matthias Fuchs wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/101046/
> -----------------------------------------------------------
> 
> (Updated April 7, 2011, 2:08 p.m.)
> 
> 
> Review request for Plasma and Aaron J. Seigo.
> 
> 
> Summary
> -------
> 
> The comic plasmoid uses prefetching by calling Plasma::DataEngine::query(source).
> Yet apparantly these created sources do not get removed automatically (?) causing an increase of memory usage the more comics are viewed.
> 
> E.g. looking at 15 strips of Lackadaisy that had not been cached before caused a memory usage of 114 MB for the plasmoidviewer. The patch reduces the usage in the same case to 52.9 MB. Each of these comics has a size between 1.2 MB and 2.6 MB.
> So please comment on the patch! :)
> 
> I wonder why it is still that high with the patch after looking at some comics, so if you can help to reduce that further that would be great.
> Further I wonder if some of the perceived "plasma mem leak" reports are caused by the way the comic plasmoid works.
> 
> 
> Diffs
> -----
> 
>   applets/comic/CMakeLists.txt 8513d9c 
>   applets/comic/comic.h 7134c72 
>   applets/comic/comic.cpp 3785f4f 
>   applets/comic/prefetcher.h PRE-CREATION 
>   applets/comic/prefetcher.cpp PRE-CREATION 
> 
> Diff: http://git.reviewboard.kde.org/r/101046/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Matthias
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/plasma-devel/attachments/20110407/64639263/attachment.htm 


More information about the Plasma-devel mailing list