The files option specifies the number of block-oriented files kept open at any given time. Block-oriented files include EntitySets, relationships, application directories, compiled application programs, compiled forms files, and working files. Document files and sort/merge files are not included.
Zim keeps as many block-oriented files open as possible, because excessive file opening reduces performance. When a block-oriented file is required, the software checks if the file is already open. If the file is not open, the software locates an open file that is not in use, closes it, and opens the new files. But the software cannot keep an unlimited number of files open, as most operating systems limit the number of open files. Because the operating system limit usually includes all types of files, the files option setting must be low enough to leave room for non-block-oriented files.
The default value for the files option is usually appropriate. However, in Windows and UNIX environments that have been configured to use a file limit greater than 20, about eight additional files must be kept open to account for non-block-oriented files. In Windows, Zim can keep 128 disk files open simultaneously if the operating system or network enables it. Consult your operating system or network documentation to learn how to configure your operating system for accessing more open files at one time.
Minimizing the number of physical file close and open operations can have a great effect on performance. Every time a block-oriented file is closed, the buffers associated with that file are released. If the file statistics option is enabled, every close of a block-oriented file is recorded in the zimstats file. Frequent entries for the same file are an indication that the files setting is too low.