Summary: | A lot of memory used after scaling the image multiple times | ||
---|---|---|---|
Product: | [Applications] krita | Reporter: | Juan Palacios <jpalaciosdev> |
Component: | General | Assignee: | Dmitry Kazakov <dimula73> |
Status: | RESOLVED FIXED | ||
Severity: | critical | CC: | dimula73, halla |
Priority: | HI | ||
Version: | git master (please specify the git hash!) | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/calligra/7d412c717ad2b9982e9c59699985e54c7070c3fa | Version Fixed In: | |
Sentry Crash Report: | |||
Attachments: | Massif output |
Description
Juan Palacios
2013-11-20 12:50:15 UTC
Attached processed valgrind massif tool output while downscaling to 40x40 and scaling to 400x400 an image with original size of 400x400 @8-bit. I repeat this process 2 times. As result, 9GB of memory are consumed. Created attachment 83766 [details]
Massif output
Yeah, it looks something leaks there... :( Let's check with memcheck as well. What seems to happen is that the layer grows and grows. I just checked using gdb and the boundrect in KisTransformWorker::transforPass is 0, 0, 45807, 4479 Git commit 7d412c717ad2b9982e9c59699985e54c7070c3fa by Dmitry Kazakov. Committed on 27/11/2013 at 06:09. Pushed by dkazakov into branch 'master'. Fix Transorm Worker to shrink device bounds when doing scale-down When doing a scale-down a great portion of the image becomes filled with the default pixel. If the default pixel of a paint device is not fully transparent, then the exactBounds() will not shrink automatically. That is why we need to purge() all the default tiles of the paint device here. Note: the Crop visitor needs *not* the same stuff, since KisPaintDevice::crop() calls KisDataManager::setExtent() which explicitly drops all the tiles outside of the requested area. Special thanks to Boud, who has found the real cause of the bug! M +5 -0 krita/image/kis_paint_device.cc M +6 -0 krita/image/kis_paint_device.h M +6 -0 krita/image/kis_transform_worker.cc M +2 -0 krita/image/tiles3/kis_tiled_data_manager.cc http://commits.kde.org/calligra/7d412c717ad2b9982e9c59699985e54c7070c3fa |