JFFS2 memLevel and windowBits
Karl(Kai) Ji
k.ji at cn.metrologic.com
Mon Mar 29 03:24:45 EST 2004
Hi all,
I am working on a VZ-board with 8MB DRAM and using uClinux-2.4.17 as kernel.
It is using JFFS2 to operate its FLASH(2MB) As a no-mmu system, memory
fragmation becomes a headache for a stable performace. So I am trying to
tune down memory usage by lower variable `memLevel' and `windowBits'. the
default value for memLevel is 8 and windowBits=15.
memLevel=7 and windowBits=15 seems to be ok but memLevel=8 and windowBits=14
unfortunately do not work. Why is that? From reading the comments in
zlib.h/zconf.h seems such modification is allowed.
/* The memory requirements for deflate are (in bytes):
(1 << (windowBits+2)) + (1 << (memLevel+9))
that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
plus a few kilobytes for small objects. For example, if you want to reduce
the default memory requirements from 256K to 128K, compile with
make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
Of course this will generally degrade compression (there's no free lunch).
The memory requirements for inflate are (in bytes) 1 << windowBits
that is, 32K for windowBits=15 (default value) plus a few kilobytes
for small objects.
*/
Any hints is appreciated.
Karl
More information about the linux-mtd
mailing list