RSS/Atom feed Twitter
Site is read-only, email is disabled

Is there any way to free Gimp memory and avoid restarting it?

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

12 of 12 messages available
Toggle history

Please log in to manage your subscriptions.

Is there any way to free Gimp memory and avoid restarting it? jEsuSdA 8) 01 Feb 22:15
  Is there any way to free Gimp memory and avoid restarting it? jEsuSdA 8) 01 Feb 22:35
   Is there any way to free Gimp memory and avoid restarting it? Ofnuts 02 Feb 08:58
    Is there any way to free Gimp memory and avoid restarting it? jEsuSdA 8) 02 Feb 12:09
    Is there any way to free Gimp memory and avoid restarting it? jEsuSdA 8) 05 Feb 15:35
     Is there any way to free Gimp memory and avoid restarting it? Øyvind Kolås 05 Feb 18:17
      Is there any way to free Gimp memory and avoid restarting it? Peter Suetterlin 06 Feb 17:23
       Is there any way to free Gimp memory and avoid restarting it? Liam R E Quin 06 Feb 20:07
     Is there any way to free Gimp memory and avoid restarting it? Ofnuts 06 Feb 09:14
      Is there any way to free Gimp memory and avoid restarting it? C R via gimp-developer-list 06 Feb 10:38
      Is there any way to free Gimp memory and avoid restarting it? Robert Krawitz 06 Feb 13:13
       Is there any way to free Gimp memory and avoid restarting it? Diogo Piçarra via gimp-developer-list 06 Feb 14:13
jEsuSdA 8)
2019-02-01 22:15:36 UTC (almost 6 years ago)

Is there any way to free Gimp memory and avoid restarting it?

Hi!

When editing several images in Gimp (10Mpixels each one), Gimp consumes memory little by little (sometime not so little by little ;) ) and this memory does not get free instead the images where closed.

So, after few time using Gimp, it consumes ALL MEMORY available and I must close and start again.

Is there any way to force Gimp to free memory?

Why if I open a image, when I close it after editing the memory used by Gimp for this image is not liberated?

I mean, if I load an image and the Gimp memory consumption increases 400MB, and I open another one (another 400MB more), I expect when I close the first one, Gimp should free the 400MB of memory reserved to the first image edition. Is something working wrong?

This is a very important think to me because I usually do long editing session where I could retouch about 50 images and, obviously is very annoying to close and restart Gimp every 5 or 6 processed images.

Thanks a lot.

GIMP 2.10.8 over Debian GNU/Linux (Testing)

jEsuSdA 8)
2019-02-01 22:35:37 UTC (almost 6 years ago)

Is there any way to free Gimp memory and avoid restarting it?

El 1/2/19 a las 23:15, jEsuSdA 8) escribió:

Hi!

When editing several images in Gimp (10Mpixels each one), Gimp consumes memory little by little (sometime not so little by little ;) ) and this memory does not get free instead the images where closed.

So, after few time using Gimp, it consumes ALL MEMORY available and I must close and start again.

Is there any way to force Gimp to free memory?

Why if I open a image, when I close it after editing the memory used by Gimp for this image is not liberated?

I mean, if I load an image and the Gimp memory consumption increases 400MB, and I open another one (another 400MB more), I expect when I close the first one, Gimp should free the 400MB of memory reserved to the first image edition. Is something working wrong?

This is a very important think to me because I usually do long editing session where I could retouch about 50 images and, obviously is very annoying to close and restart Gimp every 5 or 6 processed images.

Thanks a lot.

GIMP 2.10.8 over Debian GNU/Linux (Testing)

Here some screenshots:

After opening and editing 3 images (10Mpix each one):

http://pasteall.org/pic/show.php?id=9066d31d4341eb69702b2dc223500215 http://pasteall.org/pic/show.php?id=6382dab480d0042e8d1479e226efb0e7

3 opened images = 4.4 GB of memory

Here, after opening, edit AND CLOSE 4 more images:

http://pasteall.org/pic/show.php?id=ee7a14d2803d7f62f0eb65d23c54650a http://pasteall.org/pic/show.php?id=1f442cc78affbb9cde59be9e13e5a2d4

3 opened images = 6.3 GB of memory

Thanks! ;)

Ofnuts
2019-02-02 08:58:24 UTC (almost 6 years ago)

Is there any way to free Gimp memory and avoid restarting it?

On 2/1/19 11:35 PM, jEsuSdA 8) wrote:

El 1/2/19 a las 23:15, jEsuSdA 8) escribió:

Hi!

When editing several images in Gimp (10Mpixels each one), Gimp consumes memory little by little (sometime not so little by little ;) ) and this memory does not get free instead the images where closed.

So, after few time using Gimp, it consumes ALL MEMORY available and I must close and start again.

Is there any way to force Gimp to free memory?

Why if I open a image, when I close it after editing the memory used by Gimp for this image is not liberated?

I mean, if I load an image and the Gimp memory consumption increases 400MB, and I open another one (another 400MB more), I expect when I close the first one, Gimp should free the 400MB of memory reserved to the first image edition. Is something working wrong?

This is a very important think to me because I usually do long editing session where I could retouch about 50 images and, obviously is very annoying to close and restart Gimp every 5 or 6 processed images.

Thanks a lot.

GIMP 2.10.8 over Debian GNU/Linux (Testing)

Here some screenshots:

After opening and editing 3 images (10Mpix each one):

http://pasteall.org/pic/show.php?id=9066d31d4341eb69702b2dc223500215 http://pasteall.org/pic/show.php?id=6382dab480d0042e8d1479e226efb0e7

3 opened images = 4.4 GB of memory

Here, after opening, edit AND CLOSE 4 more images:

http://pasteall.org/pic/show.php?id=ee7a14d2803d7f62f0eb65d23c54650a http://pasteall.org/pic/show.php?id=1f442cc78affbb9cde59be9e13e5a2d4

3 opened images = 6.3 GB of memory

The fact that the memory isn't marked free doesn't mean it is unusable. Tried in Gimp 2.10 on Ubuntu:

- load 5 20MPx Jpegs: memory is 1.35GB

- close all: memory still at 1.35GB

- load them again: memory is 1.4GB

- close all: memory still at 1.4GB

- load them again: memory is 1.4GB

- close all: memory still at 1.4GB

So the memory seems reused...

jEsuSdA 8)
2019-02-02 12:09:45 UTC (almost 6 years ago)

Is there any way to free Gimp memory and avoid restarting it?

El 2/2/19 a las 9:58, Ofnuts escribió:

The fact that the memory isn't marked free doesn't mean it is unusable. Tried in Gimp 2.10 on Ubuntu:

- load 5 20MPx Jpegs: memory is 1.35GB

- close all: memory still at 1.35GB

- load them again: memory is 1.4GB

- close all: memory still at 1.4GB

- load them again: memory is 1.4GB

- close all: memory still at 1.4GB

So the memory seems reused...

Hi!

In my case, the memory marked as used is actually used (this is why I send you the LXTask screenshots).

In fact, if I use Gimp for long time, it consumes all free memory and linux has to use swap. This is why I have to restart Gimp.

Concerning your tests, I only can say that my own are not only opening and closing images but doing few tasks on them: color adjust, few filters, adding some layers and maks, etc.

Maybe this could makes some difference (e.g. the memory used for undo actions).

This is my Gimp configuration (maybe it could help):

https://i.imgur.com/HC2BEbR.png

Thanks!

jEsuSdA 8)
2019-02-05 15:35:08 UTC (almost 6 years ago)

Is there any way to free Gimp memory and avoid restarting it?

El 2/2/19 a las 9:58, Ofnuts escribió:

The fact that the memory isn't marked free doesn't mean it is unusable. Tried in Gimp 2.10 on Ubuntu:

- load 5 20MPx Jpegs: memory is 1.35GB

- close all: memory still at 1.35GB

- load them again: memory is 1.4GB

- close all: memory still at 1.4GB

- load them again: memory is 1.4GB

- close all: memory still at 1.4GB

So the memory seems reused...

I was thinking about your tests and the values seems to be a bit strange: I mean, I you load 5 images and Gimp takes 1.35GB Memory, why when you close all the images gimp still taking 1.35GB instead of less than?

In the same way, if you load again the same images, why Gimp consumes more memory and its memory consumption rises from 1.35 to 1.40... and, again, when the images are closed the memory does not get back to a lower value.

I think this values can corroborate my theory about Gimp lack of memory release I suffer and which is absolutely needed when working in professional environments.

Why Gimp does not free the memory? Any idea?

Thanks!

Øyvind Kolås
2019-02-05 18:17:58 UTC (almost 6 years ago)

Is there any way to free Gimp memory and avoid restarting it?

On Tue, Feb 5, 2019 at 4:35 PM jEsuSdA 8) wrote:

So the memory seems reused...

I was thinking about your tests and the values seems to be a bit strange: I mean, I you load 5 images and Gimp takes 1.35GB Memory, why when you close all the images gimp still taking 1.35GB instead of less than?

In the same way, if you load again the same images, why Gimp consumes more memory and its memory consumption rises from 1.35 to 1.40... and, again, when the images are closed the memory does not get back to a lower value.

If you need to restrict the amount of memory GIMP is permitted to use (before swapping tiles of the image out to disk and being slower) you should adjust the tile-cache-size in GIMP's preferences.

Apart from memory leaks which are bugs, GIMP/GEGL are telling the used memory allocators that memory is no longer used - lower levels of the stack however do not free up used memory. By design allocators tend to keep freed memory around for reuse in future allocation calls, for more information see:
https://stackoverflow.com/questions/5994543/problem-usage-memory-in-c/5994981#5994981

Ofnuts
2019-02-06 09:14:21 UTC (almost 6 years ago)

Is there any way to free Gimp memory and avoid restarting it?

On 2/5/19 5:35 PM, jEsuSdA 8) wrote:

El 2/2/19 a las 9:58, Ofnuts escribió:

The fact that the memory isn't marked free doesn't mean it is unusable. Tried in Gimp 2.10 on Ubuntu:

- load 5 20MPx Jpegs: memory is 1.35GB

- close all: memory still at 1.35GB

- load them again: memory is 1.4GB

- close all: memory still at 1.4GB

- load them again: memory is 1.4GB

- close all: memory still at 1.4GB

So the memory seems reused...

I was thinking about your tests and the values seems to be a bit strange: I mean, I you load 5 images and Gimp takes 1.35GB Memory, why when you close all the images gimp still taking 1.35GB instead of less than?

In the same way, if you load again the same images, why Gimp consumes more memory and its memory consumption rises from 1.35 to 1.40... and, again, when the images are closed the memory does not get back to a lower value.

I think this values can corroborate my theory about Gimp lack of memory release I suffer and which is absolutely needed when working in professional environments.

Why Gimp does not free the memory? Any idea?

If memory was truly leaked,  I would have seen 1.35, 2.7, 4.05... Since there is no significant memory increase, we can assume that this memory is reused. For the rest, see Øyvind's answer.

C R via gimp-developer-list
2019-02-06 10:38:38 UTC (almost 6 years ago)

Is there any way to free Gimp memory and avoid restarting it?

Does GIMP clear undo memory associated with images that have been closed (without closing GIMP)?
Thanks for the great answers, everyone. I'm learning a lot about GIMP memory management here!

-C

On Wed, Feb 6, 2019 at 9:14 AM Ofnuts wrote:

On 2/5/19 5:35 PM, jEsuSdA 8) wrote:

El 2/2/19 a las 9:58, Ofnuts escribió:

The fact that the memory isn't marked free doesn't mean it is unusable. Tried in Gimp 2.10 on Ubuntu:

- load 5 20MPx Jpegs: memory is 1.35GB

- close all: memory still at 1.35GB

- load them again: memory is 1.4GB

- close all: memory still at 1.4GB

- load them again: memory is 1.4GB

- close all: memory still at 1.4GB

So the memory seems reused...

I was thinking about your tests and the values seems to be a bit strange: I mean, I you load 5 images and Gimp takes 1.35GB Memory, why when you close all the images gimp still taking 1.35GB instead of less than?

In the same way, if you load again the same images, why Gimp consumes more memory and its memory consumption rises from 1.35 to 1.40... and, again, when the images are closed the memory does not get back to a lower value.

I think this values can corroborate my theory about Gimp lack of memory release I suffer and which is absolutely needed when working in professional environments.

Why Gimp does not free the memory? Any idea?

If memory was truly leaked, I would have seen 1.35, 2.7, 4.05... Since there is no significant memory increase, we can assume that this memory is reused. For the rest, see Øyvind's answer.

_______________________________________________ gimp-developer-list mailing list
List address: gimp-developer-list@gnome.org List membership:
https://mail.gnome.org/mailman/listinfo/gimp-developer-list List archives: https://mail.gnome.org/archives/gimp-developer-list

Robert Krawitz
2019-02-06 13:13:54 UTC (almost 6 years ago)

Is there any way to free Gimp memory and avoid restarting it?

On Wed, 6 Feb 2019 11:14:21 +0200, Ofnuts wrote:

On 2/5/19 5:35 PM, jEsuSdA 8) wrote:

El 2/2/19 a las 9:58, Ofnuts escribió:

The fact that the memory isn't marked free doesn't mean it is unusable. Tried in Gimp 2.10 on Ubuntu:

- load 5 20MPx Jpegs: memory is 1.35GB

- close all: memory still at 1.35GB

- load them again: memory is 1.4GB

- close all: memory still at 1.4GB

- load them again: memory is 1.4GB

- close all: memory still at 1.4GB

So the memory seems reused...

I was thinking about your tests and the values seems to be a bit strange: I mean, I you load 5 images and Gimp takes 1.35GB Memory, why when you close all the images gimp still taking 1.35GB instead of less than?

In the same way, if you load again the same images, why Gimp consumes more memory and its memory consumption rises from 1.35 to 1.40... and, again, when the images are closed the memory does not get back to a lower value.

I think this values can corroborate my theory about Gimp lack of memory release I suffer and which is absolutely needed when working in professional environments.

Why Gimp does not free the memory? Any idea?

If memory was truly leaked,  I would have seen 1.35, 2.7, 4.05... Since there is no significant memory increase, we can assume that this memory is reused. For the rest, see Øyvind's answer.

It's possible that some memory was leaked, just not all of it.

Robert Krawitz                                     

***  MIT Engineers   A Proud Tradition   http://mitathletics.com  ***
Member of the League for Programming Freedom  --  http://ProgFree.org
Project lead for Gutenprint   --    http://gimp-print.sourceforge.net

"Linux doesn't dictate how I work, I dictate how Linux works."
--Eric Crampton
Diogo Piçarra via gimp-developer-list
2019-02-06 14:13:13 UTC (almost 6 years ago)

Is there any way to free Gimp memory and avoid restarting it?

I think you should open a bug report: https://www.gimp.org/bugs/

Robert Krawitz escreveu no dia quarta, 6/02/2019 à(s) 13:34:

On Wed, 6 Feb 2019 11:14:21 +0200, Ofnuts wrote:

On 2/5/19 5:35 PM, jEsuSdA 8) wrote:

El 2/2/19 a las 9:58, Ofnuts escribió:

The fact that the memory isn't marked free doesn't mean it is unusable. Tried in Gimp 2.10 on Ubuntu:

- load 5 20MPx Jpegs: memory is 1.35GB

- close all: memory still at 1.35GB

- load them again: memory is 1.4GB

- close all: memory still at 1.4GB

- load them again: memory is 1.4GB

- close all: memory still at 1.4GB

So the memory seems reused...

I was thinking about your tests and the values seems to be a bit strange: I mean, I you load 5 images and Gimp takes 1.35GB Memory, why when you close all the images gimp still taking 1.35GB instead of less than?

In the same way, if you load again the same images, why Gimp consumes more memory and its memory consumption rises from 1.35 to 1.40... and, again, when the images are closed the memory does not get back to a lower value.

I think this values can corroborate my theory about Gimp lack of memory release I suffer and which is absolutely needed when working in professional environments.

Why Gimp does not free the memory? Any idea?

If memory was truly leaked, I would have seen 1.35, 2.7, 4.05... Since there is no significant memory increase, we can assume that this memory is reused. For the rest, see Øyvind's answer.

It's possible that some memory was leaked, just not all of it. --
Robert Krawitz

*** MIT Engineers A Proud Tradition http://mitathletics.com *** Member of the League for Programming Freedom -- http://ProgFree.org Project lead for Gutenprint -- http://gimp-print.sourceforge.net

"Linux doesn't dictate how I work, I dictate how Linux works." --Eric Crampton
_______________________________________________ gimp-developer-list mailing list
List address: gimp-developer-list@gnome.org List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list List archives: https://mail.gnome.org/archives/gimp-developer-list

Peter Suetterlin
2019-02-06 17:23:13 UTC (almost 6 years ago)

Is there any way to free Gimp memory and avoid restarting it?

yvind Kols wrote:

If you need to restrict the amount of memory GIMP is permitted to use (before swapping tiles of the image out to disk and being slower) you should adjust the tile-cache-size in GIMP's preferences.

Well, you do want GIMP to use the memory if it needs it.

Apart from memory leaks which are bugs, GIMP/GEGL are telling the used memory allocators that memory is no longer used - lower levels of the stack however do not free up used memory. By design allocators tend to keep freed memory around for reuse in future allocation calls,

But this is not very social to other programs running on the same machine, is it? I have noticed this behavior of GIMP myself before, and also thought this is not how it should be...

Liam R E Quin
2019-02-06 20:07:33 UTC (almost 6 years ago)

Is there any way to free Gimp memory and avoid restarting it?

On Wed, 2019-02-06 at 18:23 +0100, Peter Suetterlin wrote:

By design allocators tend

to
keep freed memory around for reuse in future allocation calls,

But this is not very social to other programs running on the same machine, is
it? I have noticed this behavior of GIMP myself before, and also thought this is not how it should be...

It’s the default behaviour for almost all programs. On Linux systems you may be able to set M_TRIM_THRESHOLD_ to return memory to the operating system in some circumstances, and also MALLOC_MMAP_THRESHOLD_ to make malloc() allocate memory in a way that gets reused more easily. See the man page for mallopt.

On Unix systems (including Linux and Mac OS X) this behaviour is not especially unfriendly: the unused space isn’t necessarily kept in main memory.

Liam

Liam Quin - web slave for https://www.fromoldbooks.org/
with fabulous vintage art and fascinating texts to read.
Click here to have the slave beaten.