GNOME Bugzilla – Bug 303371
tile-cache-size > 4GB causes warnings
Last modified: 2008-01-15 12:53:43 UTC
Please describe the problem: If I coose a multiple of 4GB for the Tile Cache some operations are really slow. For example if I use "Select Continous Regions" (Fuzzy Select) it can took about 50 seconds until you can continue to work. If another Cache Size is choosen, for example 1GB or 5GB or even 4097MB, the same operation with the same picture takes about 2 seconds. Some other operations are slow too, but not so extreme. But I have only tried a few. For example "Toogle QuickMask" needs about 3 seconds instead of 1 or 2. First I thougt the problem is that I only have 512MB of memory, but I can choose 5GB and there is no such problem. If Gimp is started with the console it gives me the following message: (gimp-2.0:6229): Gimp-Base-WARNING **: cache: unable to find room for a tile This message only appears with a Tile Cache of a multiple of 4GB and it is repeated a lot of times. So it can slow down the system when Gimp is started with the console. Steps to reproduce: 1. Start Gimp with the console 2. Set the Tile Cache to 4GB 3. Create a new picture with a size about 1000x1000 pixels 4. You can try to use "Select continous regions" but because of all the warnings this may take a lot of time Actual results: I get a lot of warnings: (gimp-2.0:6266): Gimp-Base-WARNING **: cache: unable to find room for a tile If I start Gimp with the console it tooks more than 5 minutes to use "Select continous regions" (Fuzzy select). If Gimp is started out of the Start-Menu then this Fuzzy select needs about 35 seconds. If another Cache size than 4GB, 8GB and so on is choosen than this operation takes about 1 second. (Tested with an emty Picture; size 1000x1000 pixels) Expected results: It should not take such a long time and Gimp should not produce su much warnings. Does this happen every time? Yes, it happens every time. Other information: I use the Version 2.0.4 of Gimp (Linux, x86, gentoo) but I also tried the Windows Version 2.2.1. And this version seems to have the same problem even though I haven't seen the warnings there because of the different behavior of the Windows "cmd".
I can reproduce the warnings with newer versions of GIMP.
Obviously, the tile cache size must not be allowed to be chosen larger than G_MAXULONG which would be (almost) 4GB on your system. You can only use a larger tile cache if you can address more than 4GB of memory. In other words, you need a 64bit processor.
Fixed in both branches: 2005-05-08 Sven Neumann <sven@gimp.org> * app/config/gimpbaseconfig.c: limit the tile-cache-size to G_MAXULONG or GIMP_MAX_MEMSIZE, whatever is smaller. Fixes bug #303371.
I wanted to mention that this warning only appears if I choose EXACTLY 4GB, 8GB and so on. I don't get this warning with a cache size of 4097MB for example.
The max size the data type can handle is 4GB - 1. When you chose 4GB (or any multiple of it), the tile cache size was set to 0, since you overflowed the data type. When you set it to 4097MB, you really set the tile cache size to 1MB. The per process memory size limit is actually 2 GB for most 32-bit programs, but it can very depending on platform and OS.