I know, that zimlib uses quite some memory. It has a decompress cache for
articles and a cache for directory entries. It caches up to 16 chunks, which
are normally 1M and 512 directory entries (some few bytes each). To reduce
memory consumption the directory cache is not so important but the decompress
cache is. Currently this 16 is a fixed size (defined in src/fileimpl.cpp).
It is a quite bad solution to hard code that value but to add a "--low-
memory"-flag and compile a smaller value into the lib is not really a very good
option. It would be better to either let the user of the library decide or to
use e.g. a environment variable to tune it. I'm not sure, what is the best
What do you think? The library may read the value from the env variable
ZIM_CLUSTERCACHE and ZIM_DIRENTCACHE and default to the values above. Then the
size is configurable without recompilation.