X
2282 Rate this article:
5.0

Understanding the ENVI Tile and Cache Size Settings

Anonym

From the main ENVI Classic menu, under File -> Preferences -> Miscellaneous, users are able to set Cache Size and Image Tile Size. This article discusses what these settings mean.

Note that even though these preferences are only accessible in ENVI Classic, they are used in any ENVI processing that internally uses older ENVI Classic source code.

In order for ENVI to process images that are much larger than the total amount of RAM available on the system, large images are broken into pieces that are small enough for the system to handle. Each piece is called a tile, and when the image is processed, only one tile is read into memory at a time. The Image Tile Size setting in the ENVI configuration file determines the size for the tile, and thus how much of an image is read into RAM and processed at a time. If the entire image is smaller than the Image Tile Size setting, then the entire image is processed in one tile. When processing on one tile is finished, ENVI releases that tile’s memory, and then reads the next tile for processing. If ENVI tries to read in a tile that is larger than the amount of contiguous RAM available on your machine at the time you start a process, then you will get the error: "unable to allocate memory to make array."

Even if you have a very large amount of RAM, it is important to remember that each tile must fit into a contiguous section of memory. Because RAM quickly becomes fragmented, it is dangerous to have a large tile setting. So, for the tile size, smaller is better. Because the Image Tile Size setting has very little effect on performance, we recommend that it be kept at the default value of 1 MB, and suggest that it never exceed about 5% of physical memory. On a typical system with 2GB of RAM this would be approximately 100 MB.

There is one case in which ENVI will use a tile size that is different than the Image Tile Size setting in the configuration file. When spectral processing is being performed, the tile size will be equal to the number of samples times the number of bands, regardless of the tile size setting. So, for spectral processing it is possible for the tile to exceed the tile size setting, although this is rarely the case. In fact, spectral tiles are usually smaller than the configuration file’s tile size setting.

The Cache Size setting in the ENVI configuration file does not directly affect memory allocation, but it helps ENVI keep an eye on how much RAM is likely to be available. The cache size is specified because IDL does not have any way to know how much RAM is available on your machine. When you set the cache size it tells ENVI that when you have used up that much RAM, ENVI should start to remove unnecessary items from RAM to make more available (sometimes ENVI will keep certain kinds of data in RAM to speed performance, although these are not required for ENVI to run and can be released if memory is low). The cache setting is not a fixed upper limit on the amount of RAM that ENVI will use, it is just a benchmark that ENVI uses to gauge whether the amount of RAM you have used up is a little or a lot. It is configurable because of the wide variety of RAM on different machines.

If your Cache Size setting is large, then ENVI will not start cleaning up RAM until that large amount of RAM has been used. This means that less RAM will be left available for further processing. To minimize your chances of starting a process and then running out of RAM in the middle of a process (when ENVI can't clear RAM), you want to have a reasonable amount of RAM available even after your cache is full. On single-user machines, we recommend that the cache be set to 50-75% of the available physical RAM on the system. For example, if you have 2 GB of RAM, then a reasonable cache size might be 1000 - 1500 Mb. For multi-user systems (such as UNIX workstations) the cache size should be reduced to reflect the amount of physical RAM that will typically be available.

Generally, it is best to err on the side of a smaller cache size.

Reviewed 10/15/14 by PS