After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 349434 - Eog use all memory (1Gb) and swap (1Gb) if rotating image. Memory leak?
Eog use all memory (1Gb) and swap (1Gb) if rotating image. Memory leak?
Status: RESOLVED FIXED
Product: eog
Classification: Core
Component: collection
2.14.x
Other All
: Normal normal
: ---
Assigned To: EOG Maintainers
EOG Maintainers
: 356925 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-07-31 13:56 UTC by Oleksij Rempel
Modified: 2006-09-26 14:11 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14


Attachments
possible fix (579 bytes, patch)
2006-07-31 16:00 UTC, Felix Riemann
none Details | Review

Description Oleksij Rempel 2006-07-31 13:56:26 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
Comment 1 Felix Riemann 2006-07-31 15:12:38 UTC
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.
Comment 2 Felix Riemann 2006-07-31 16:00:42 UTC
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().
Comment 3 Oleksij Rempel 2006-08-01 07:39:16 UTC
It's working for me. Thenk you!
Comment 4 Lucas Rocha 2006-08-02 02:34:29 UTC
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>.
Comment 5 Martin Ejdestig 2006-09-26 14:11:02 UTC
*** Bug 356925 has been marked as a duplicate of this bug. ***