GNOME Bugzilla – Bug 767719
Gimp not closing after processing large files
Last modified: 2018-01-05 19:57:32 UTC
Since upgrading to 2.8.16 I noticed that Gimp does not close at all or closes only after a very long time (>15min) after I had processed and closed a large file (20,000 x 10,000pxls). Checking Task Manager it uses about 25% CPU and releases memory very slowly in small steps, i.e. the window appears to be frozen but tends to recover after a very long time, sometimes up to 30min. This only happens after closing the file, Gimp does not have any issues processing these files with filters or exporting etc. I experience the same on 2 machines with Win7 64bit, one with 8GB the other with 16GB RAM. I'd assume it is a problem with memory handling.
Is it enough to just open such files and close them again?
I've reproduced this a couple of days ago and pointed it at g_slist_remove from the GEGL tile cache (as mentioned on IRC). Hundreds of thousands of memory references are done per tile, taking from 1 to 50ms each. That linked list shouldn't probably be there at all, or use more efficient code that only swaps pointers instead of doing a search. Working on a fix.
Created attachment 330145 [details] [review] GEGL's tile cache moves from singly-linked lists to hash tables, making loading and closing several times more efficient I meant 1-50ms per g_slist_remove(), not per each memory access (no swapping was involved). This patch makes things a lot better for me. I reckon it's a good start.
This isn't platform-specific, is it?
No. I was testing it on amd64 Gentoo Linux with -O3 -march=native and the patch only uses standard glib constructs.
Review of attachment 330145 [details] [review]: The patch has been committed - but is probably also not the cause of the original bug report, since GIMP-2.8 did not use GeglBuffers for neither its layers nor loading.
(In reply to Michael Schumacher from comment #1) > Is it enough to just open such files and close them again? Opening the file and closing it without any changes does not cause the issue, memory is released instantaneously. Playing around with some of the usual processing steps I found the issue occurs if I increase saturation, export the file to JPG and then close without saving the changes. Other filters or modifications I usually use don't appear to cause the problem.
Just update to version 2.8.18 and found that the problem persists.
Just updated to version 2.8.18 and found that the problem persists.
Just noticed that not only the closing function is affected but also scaling. After adjusting the Saturation of a 20,000x10,000 pxl image via Colors-Hue-Saturation, the scaling function pretty much becomes unresponsive, it may eventually complete but can take up to 15 minutes or longer. I believe the function Colors-Hue-Saturation is causing issues that subsequently slow other Gimp functions down to a degree that it appears to be frozen.
I doubt that we will change anything in 2.8 memory management. Klaus, can you check if the issues are fixed in git master?
My apologies but I had to replace my laptop and do no longer have this problem since doubling my RAM.
Let's close then, I guess. If ever this problem happens again, please feel free to reopen this bug report. Thanks.