Bug 162505 - Gwenview crashes, out of memory
Summary: Gwenview crashes, out of memory
Status: RESOLVED WORKSFORME
Alias: None
Product: gwenview
Classification: Applications
Component: general (show other bugs)
Version: 2.0
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: Gwenview Bugs
URL:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2008-05-23 10:14 UTC by Seb
Modified: 2018-10-27 02:27 UTC (History)
3 users (show)

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 Seb 2008-05-23 10:14:15 UTC
Version:            (using KDE 4.0.4)
Installed from:    SuSE RPMs
OS:                Linux

Very often Gwenview crashes.

Application case: Go through a list of photos (about 2.5 MB jpegs). Edit (rotate) some of them, say 15.

Gwenview now reqires about 1.5 GB RAM! After rotating 30 images without saving during this process, Gwenview crashes (computer then is totally in swap, no mouse movement even possible). 

It does not seem to be a memory leak, but a design issue:

Does Gwenview store jpeg images as jpegs or does it expand the images to their rel size (this seems to, since the memory usage grows by about 10MB when loading a single image)?

Does Gwenview store the operation ("rotate") or does it save the images during the command flow (in order to provide undo/redo functionality)??? (memory grows while rotating images)
Comment 1 Seb 2008-05-23 10:20:55 UTC
removed this bug since I commited it twice at the same time!
Comment 2 Pino Toscano 2008-05-23 10:22:42 UTC
Closed the right bug, opening again.
Comment 3 Aurelien Gateau 2008-05-27 10:50:17 UTC
Gwenview keeps modified images in memory, that's why memory usage grows 
that much. It should probably store the result in temporary files when 
memory usage starts to be too high.

Unfortunately we are in feature freeze right now, so implementing this 
is a bit risky. It will have to wait for KDE4.2. All I can suggest for 
now is to save your changes when they become too numerous.
Comment 4 Seb 2008-05-28 12:02:21 UTC
I am afraid that using temporary files kills the performance. One issue is the disk usage, second the hdd traffic (many notebooks are weak regarding hdd capacity and speed).

When considering the available modifier operations in Gwenview, I wonder if the edited steps must be saved at all. It could be wise to save the original image (and even here no high resolution image must be stored, but only the one which is displayed) and additionally the operation in terms of an 'enum'. No more storage. When the image is going to be shown, the operations will be applied at runtime to the original picture. As long as the operations consider simple resize/scaling and rotating, this should not be a performance problem at all...

Off course, a comparing benchmark is required... 
Comment 5 Aurelien Gateau 2008-06-04 00:12:08 UTC
SVN commit 816456 by gateau:

Warn the user when he made too many changes.
CCBUG:162505


 M  +109 -63   app/savebar.cpp  
 M  +1 -0      lib/CMakeLists.txt  
 M  +8 -0      lib/document/document.cpp  
 M  +5 -0      lib/document/document.h  
 M  +6 -0      lib/gwenviewconfig.kcfg  


WebSVN link: http://websvn.kde.org/?view=rev&revision=816456
Comment 6 Petr Pajas 2008-09-10 22:34:12 UTC
The patch is supposed to be a joke, right? I'm running gwenview from KDE4.1.1 on openSUSE 11.0. After rotating about 30 photos, it told me to save it. I did (took awfully long, which in fact spoiled the whole presentation), but the memory was not returned to the system. After a few more photos the system with 2GB RAM started to swap and that was it. After waiting about 10 minutes I had to reboot using Alt+SysRq+U,B. Very nice thing to do when you are showing your photos to your family.

So, please consider some completely different solution (e.g. you can just record the type of the changes and filenames and apply them afterwards) or make an option to save after each change (and make it default, otherwise your application is a system killer). BTW, gwenview from KDE3.5 works smoothly and offers much more features.

And as for waiting till KDE4.2, why do you consider fixing this problem a feature? It is rather a critical bug fix, I would say.

Best,

-- Petr
Comment 7 Dario Andres 2009-01-20 02:26:31 UTC
Any news on this ?
Comment 8 Aurelien Gateau 2009-01-20 10:00:57 UTC
Not much, except for a fix in the memory usage detection system (bug 181235). I am still not sure whether it would be better to:
- stay the way it is right now
- go for the save-to-tmp way
- go for the remember-changes-and-apply-on-save way 
Comment 9 Marian Kyral 2009-03-24 12:43:46 UTC
(In reply to comment #8)
> Not much, except for a fix in the memory usage detection system (bug 181235). I
> am still not sure whether it would be better to:
> - stay the way it is right now
> - go for the save-to-tmp way
> - go for the remember-changes-and-apply-on-save way 

What about combination?
Remember simple changes and apply them on save, store the whole (compresses) image for non trivial changes and use temp file when no memory.
Comment 10 Myriam Schweingruber 2013-04-02 15:23:11 UTC
Is this still valid for Gwenview 4.10.0 or later? I have too much RAM to test this reliably here
Comment 11 Andrew Crouthamel 2018-09-24 02:25:18 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days, the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please set the bug status as REPORTED so that the KDE team knows that the bug is ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 12 Andrew Crouthamel 2018-10-27 02:27:38 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 30 days. The bug is now closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!