On Freitag, 25. September 2009 09:38:06 Mirko Lindner wrote: > Hey, > > > Concerning the caches I suggest that the zimreader gets a configure > > option "--low-memory" which disables pre-fetching and limits the number > > of cached articles. > > I asked Mirko to file a bug for this. > > So done here[1]. > > Regards, > > /mirko > > [1] http://bugs.openzim.org/show_bug.cgi?id=10 Hi,
thank you for your report. 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 solution. 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. Tommi _______________________________________________ dev-l mailing list [email protected] https://intern.openzim.org/mailman/listinfo/dev-l
