GNOME Bugzilla – Bug 349434
Eog use all memory (1Gb) and swap (1Gb) if rotating image. Memory leak?
Last modified: 2006-09-26 14:11:02 UTC
Please describe the problem: I use EOG to edit my image collection, i need to rotate some of images but after about 20 *jpg pictures EOG take about 80% of memory. Steps to reproduce: 1. Open an image with EOG. 2. Rotate it (for example with shortcut Ctrl + r ) about 20 times ore jast edit big collection of images Actual results: Expected results: Does this happen every time? Yes Other information: ==========sys info after EOG start=============================== cat /proc/meminfo MemTotal: 1026952 kB MemFree: 818916 kB Buffers: 4620 kB Cached: 92764 kB SwapCached: 16228 kB Active: 115584 kB Inactive: 70364 kB HighTotal: 122496 kB HighFree: 256 kB LowTotal: 904456 kB LowFree: 818660 kB SwapTotal: 1325320 kB SwapFree: 1291568 kB Dirty: 0 kB Writeback: 0 kB AnonPages: 79808 kB Mapped: 26100 kB Slab: 10896 kB PageTables: 1532 kB NFS Unstable: 0 kB Bounce: 0 kB CommitLimit: 1838796 kB Committed_AS: 208376 kB VmallocTotal: 114680 kB VmallocUsed: 2412 kB VmallocChunk: 112224 kB ----------------and this too---------------------- # ps aux | grep eog lex 10947 1.7 2.6 62684 27540 ? Sl 14:36 0:01 eog file:///home/lex/Desktop/cd/inna/kg-inna/inna-kg-028.jpg ===================================================== =========its after some image rotation====================== cat /proc/meminfo MemTotal: 1026952 kB MemFree: 13332 kB Buffers: 304 kB Cached: 16072 kB SwapCached: 108840 kB Active: 505328 kB Inactive: 486396 kB HighTotal: 122496 kB HighFree: 244 kB LowTotal: 904456 kB LowFree: 13088 kB SwapTotal: 1325320 kB SwapFree: 462636 kB Dirty: 0 kB Writeback: 0 kB AnonPages: 867560 kB Mapped: 7744 kB Slab: 9436 kB PageTables: 3112 kB NFS Unstable: 0 kB Bounce: 0 kB CommitLimit: 1838796 kB Committed_AS: 1828484 kB VmallocTotal: 114680 kB VmallocUsed: 2412 kB VmallocChunk: 112224 kB -----------------------and this----------------- ps aux | grep eog lex 10947 19.3 81.5 1682932 837036 ? Sl 14:36 1:22 eog file:///home/lex/Desktop/cd/inna/kg-inna/inna-kg-028.jpg root 10969 0.0 0.0 2728 760 pts/0 S+ 14:43 0:00 grep eog
I can confirm this with 2.15.x too. When I simply click through my collection the memory usage stays roughly constant. But when I add a transformation eog needs more memory. Its even sufficient to take one picture and transform it several times (for example rotating it 10 times). This makes it possible to see that the needed memory increases for every applied transformation (by ~ the same amount). Even when I now click on "Undo" eog allocates (and does not free) more memory to undo the transformation. It looks like the source image/pixbuf is not correctly unreffed when I add a transformation to it.
Created attachment 69981 [details] [review] possible fix So this patch seems to fix it. Currently when I apply a transformation, the image is transformed by the job manager. When the transformation succeeded "EogImage:image_changed" is emitted launching EogScrollViews image_changed_cb(). There the pixbuf is extracted from the image and reffed. But the pixbuf was already reffed by eog_image_get_pixbuf() keeping the pixbuf at a refcount of +1 but without reference.(At least that's how I see it) This patch simply removes the additional g_object_ref().
It's working for me. Thenk you!
Applied in HEAD, eog-ng and gnome-2-14. Thanks! 2006-08-01 Lucas Rocha <lucasr@gnome.org> * libeog/eog-scroll-view.c (image_changed_cb): fix memory leak on image transformation (Fixes bug #349434). Patch from Felix Riemann <felix@hsgheli.de>.
*** Bug 356925 has been marked as a duplicate of this bug. ***