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 525016 - Gimp-Perl memory leak
Gimp-Perl memory leak
Status: RESOLVED FIXED
Product: gimp-perl
Classification: Other
Component: General
2.0.x
Other Linux
: Normal normal
: 2.4
Assigned To: gimp-perl maintainers
gimp-perl maintainers
Depends on:
Blocks:
 
 
Reported: 2008-03-29 19:50 UTC by Kevin Cozens
Modified: 2014-03-26 18:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test script to demonstrate memory leak (7.23 KB, text/plain)
2008-04-28 15:33 UTC, Kevin Cozens
  Details
Valgrind output which confirms some sort of memory leakage. (157.44 KB, text/plain)
2008-05-14 17:59 UTC, Kevin Cozens
  Details
Patch fcd8b703b1bce88f1daf2742f9f536839fab650b (12.52 KB, patch)
2014-03-17 03:36 UTC, Ed J
needs-work Details | Review

Description Kevin Cozens 2008-03-29 19:50:58 UTC
The following was originally sent to the GIMP developer mailing list by Andrei Simion:

I run Gimp 2.2 on a Red Hat machine. The Perl scripts delete the images 
that are created by using gimp_image_delete. Even so, the swap file is 
created and it inflates significantly. For instance, after creating 250 
images its size is of 2.7 GB. If the image is not deleted in the script, 
then after the same amount of images created the size of the swap file 
is of 900 MB.

I would be interested in eliminating the swap file or at least limiting 
its size. I think it should resize itself, but this doesn't happen. Is 
there a setting in gimprc for this?
Comment 1 Kevin Cozens 2008-03-29 19:52:12 UTC
Andrei has since reported that the problem still happens with the 2.4.5 version of GIMP.
Comment 2 Sven Neumann 2008-03-29 20:00:54 UTC
This report is pointless without the script that causes the problem. Please attach a small script here that shows the problem. Setting to NEEDINFO until then.
Comment 3 Kevin Cozens 2008-03-29 21:41:56 UTC
Sven, if you had been following the "Gimp-Perl leak" thread on gimp-devel you would know that the script is proprietary to the company for which the reporter works. As I did some work for the company I have a copy of the script and had already stated my intention to investigate. I will attach a script once I have a simpler version that can reproduce the problem.
Comment 4 Kevin Cozens 2008-04-28 15:33:31 UTC
Created attachment 110044 [details]
Test script to demonstrate memory leak

Additional information from Andrei:

I was told to install version 2.4 and the issue doesn't go away.

The problem is that I discovered something even worst and it does take place in both 2.2 and 2.4.

If one runs a Gimp-Perl script for a number of times, enough to use the whole physical memory, then the Gimp server crashes, it does not create the swap. That's it, no swap file is created.

I think there may be a configuration issue.
Comment 5 Kevin Cozens 2008-05-14 17:59:18 UTC
Created attachment 110914 [details]
Valgrind output which confirms some sort of memory leakage.

The attached file was captured on April 23, 2008 and seems to confirm the presence of memory leak(s). The output shows valgrind output from a run of version 2.5 of GIMP with the environment variable GSLICE set to always-malloc. GIMP was started, one Script-Fu script was run, and GIMP closed.

Sven has seen one of the valgrind reports I generated and feels that the leak is caused by something within GIMP.
Comment 6 Kevin Cozens 2008-05-18 21:21:39 UTC
Oops...typo in my last comment. I meant to say that Sven felt that the leak was *NOT* in something within GIMP.
Comment 7 Kevin Cozens 2009-12-02 19:37:08 UTC
It has been over a year with nothing further on this reported bug. It needs to be checked again to see what leaks my still exist. Looking again at the valgrind output shows that the memory reported as "definitely lost" was from something to do with libdl, fontconfig, and a pango library.
Comment 8 Tobias Mueller 2010-03-03 19:48:40 UTC
So as the necessary steps are clear and no question for non-developers are open, I reopen this bug then so that someone with free time at their hands can pick this up.
Comment 9 Ed J 2014-03-17 03:35:52 UTC
The valgrind output was for GIMP, and gimp-perl operates within another process for the Perl-Server, and one per plugin/filter. There was some memory leakage in the current GP, and the attached patch addresses that.
Comment 10 Ed J 2014-03-17 03:36:37 UTC
Created attachment 272111 [details] [review]
Patch fcd8b703b1bce88f1daf2742f9f536839fab650b
Comment 11 Kevin Cozens 2014-03-26 18:45:54 UTC
Review of attachment 272111 [details] [review]:

This patch won't apply to the current code base.

gimp2/gimp-perl/.git/rebase-apply/patch:64: space before tab in indent.
         			arg->data.d_int32	= sv2gimp_extract_noref (SvIV, "INT32"); break;
error: patch failed: t/perlplugin.t:9
error: t/perlplugin.t: patch does not apply
Patch failed at 0001 Eliminate some memory leaking. Bug 525016
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".
Comment 12 Kevin Cozens 2014-03-26 18:56:08 UTC
FYI: the patch generates another white space warning.

/home/kcozens/gimp2/gimp-perl/.git/rebase-apply/patch:64: space before tab in indent.
         			arg->data.d_int32	= sv2gimp_extract_noref (SvIV, "INT32"); break;
warning: 1 line adds whitespace errors.


commit bdf6c8b1cb0297f9bb7129fe075f1134d485122e
Author: Ed J <m8r-35s8eo@mailinator.com>
Date:   Mon Mar 17 03:32:07 2014 +0000

    Eliminate some memory leaking. Bug 525016