From: Sven Neumann <[EMAIL PROTECTED]>
   Date: Sat, 29 Mar 2008 18:24:59 +0100

   On Wed, 2008-03-26 at 22:11 -0400, Andrei Simion wrote:

   > 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 MB.

   That is not much and all it shows is that the image processing you are
   doing is using more memory than the configured tile-cache-size. I am not
   sure if I understand your problem at all...

   > 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.

   The swap file only resizes itself when tiles at the end of the swap file
   are freed. So you may have to free all tiles before the swap file
   resizes itself to zero. If if doesn't do that, then your script leaks an
   image or a drawable somewhere (or it calls a function that leaks).

Perhaps a better test would be to create 250 images, destroy them, and
repeat multiple times.  If the swap file grows from iteration to
iteration, that suggests a memory leak.  As you point out, simply
deleting some images won't necessarily allow the swap file to resize
itself (unless GIMP actively compressed the swap file, which would be
exceedingly time consuming).

A decent analogy here (and one also creates a lot of confusion) is the
behavior of "free" over time.  A lot of people get confused about why
the amount of free memory reported by the OS decreases over time, and
think that it represents a memory leak, when in fact that isn't the case.

Robert Krawitz                                     <[EMAIL PROTECTED]>

Tall Clubs International  -- or 1-888-IM-TALL-2
Member of the League for Programming Freedom -- mail [EMAIL PROTECTED]
Project lead for Gutenprint   --

"Linux doesn't dictate how I work, I dictate how Linux works."
--Eric Crampton
Gimp-developer mailing list

Reply via email to