3. Het cache-geheugen instellen

This section covers the Tile cache size setting under System Resources.

Tijdens het verwerken en manipuleren van de gegevens heeft GIMP vrij veel werkgeheugen nodig. Hoe meer er beschikbaar is hoe beter het werkt. GIMP gebruikt het geheugen van uw computer zo effectief mogelijk en probeert het werk zo snel en aangenaam mogelijk uit te voeren. Daarbij worden vele blokken van het geheugen toegewezen voor verschillende soorten van gebruik. Dat geheugen bestaat uit twee gedeelten: Zoveel mogelijk wordt het zgn. Cache-geheugen, dat is het snelle rekengeheugen van de computer gebruikt. Als dat niet genoeg is wordt een deel van de harde schijf als zgn. wisselgeheugen gebruikt, wat veel minder snel is.

Met weinig cache-geheugen moet GIMP vaker tijdelijke gegevens op de harde schijf bewaren. Met veel cache-geheugen voor GIMP blijft er minder ruimte over voor de andere programma's op uw computer, en dan moeten die vaker de harde schijf gebruiken. Dat kan het functioneren van die programma's benadelen.

Hoe moet u nu de waarde voor het cache-geheugen bepalen? Hier volgen wat tips en trucs:

Let's suppose you prefer the last option, and want to get a good value to start with. First, you need to get some data about your computer. This data is the amount of RAM installed in your system, the operating system's swap space available, and a general idea about the speed of the disks that store the operating system's swap and the directory used for GIMP's swap. You do not need to do disk tests, nor check the RPM of the disks, the thing is to see which one seems clearly faster or slower, or whether all are similar. You can change GIMP's swap directory in the Folders page of the Preferences dialog.

The next thing to do is to see how much resources you require for other apps you want to run at the same time than GIMP. So start all your tools and do some work with them, except GIMP of course, and check the usage. You can use applications like free or top, depending in what OS and what environment you use. The numbers you want is the memory left, including file cache. Modern Unix keeps a very small area free, in order to be able to keep large file and buffer caches. Linux's free command does the maths for you: check the column that says free, and the line -/+ buffers/cache. Note down also the free swap.

Now time for decisions and a bit of simple math. Basically the concept is to decide if you want to base all Tile Cache in RAM, or RAM plus operating system swap:

  1. Do you change applications a lot? Or keep working in GIMP for a long time? If you spend a lot of time in GIMP, you can consider free RAM plus free swap as available; if not, you need to go to the following steps. (If you're feeling unsure about it, check the following steps.) If you are sure you switch apps every few minutes, only count the free RAM and just go to the final decision; no more things to check.

  2. Does the operating system swap live in the same physical disk as GIMP swap? If so, add RAM and swap. Otherwise go to the next step.

  3. Is the disk that holds the OS swap faster or the same speed as the disk that holds the GIMP swap? If slower, take only the free RAM; if faster or similar, add free RAM and swap.

  4. You now have a number, be it just the free RAM or the free RAM plus the free OS swap. Reduce it a bit, to be on the safe side, and that is the Tile Cache you could use as a good start.

As you can see, all is about checking the free resources, and decide if the OS swap is worth using or will cause more problems than help.

There are some reasons you want to adjust this value, though. The basic one is changes in your computer usage pattern, or changing hardware. That could mean your assumptions about how you use your computer, or the speed of it, are no longer valid. That would require a reevaluation of the previous steps, which can drive you to a similar value or a completely new value.

Another reason to change the value is because it seems that GIMP runs too slowly, while changing to other applications is fast: this means that GIMP could use more memory without impairing the other applications. On the other hand, if you get complaints from other applications about not having enough memory, then it may benefit you to not let GIMP hog so much of it.

If you decided to use only RAM and GIMP runs slowly, you could try increasing the value a bit, but never to use also all the free swap. If the case is the contrary, using both RAM and swap, and you have problems about lack of resources, then you should decrease the amount of RAM available to GIMP.

Another trick is to put the Swap Dir on a very fast disk, or on a different disk than the one where most of your files reside. Spreading the operating system swap file over multiple disks is also a good way to speed things up, in general. And of course, you might have to buy more RAM or stop using lots of programs at the same time: you can not expect to edit a poster on a computer with 16MB and be fast.

You can also check what memory requirements your images have. The larger the images, and the number of undoes, the more resources you need. This is another way to choose a number, but it is only good if you always work with the same kind of images, and thus the real requirements do not vary. It is also helpful to know if you will require more RAM and/or disk space.