Building a small memory footprint library

There are a set of configuration options to assist you in building a small memory footprint library. These configuration options turn off specific functionality in the Berkeley DB library, reducing the code size. These configuration options include:

--enable-smallbuild

Equivalent to individually specifying all of the following configuration options. In addition, when compiling building with the GNU gcc compiler, this option uses the -Os compiler build flag instead of the default -O3.

--disable-compression
Builds Berkeley DB without support for the automatic compression of key/data pairs.
--with-cryptography=no
Builds Berkeley DB without support for cryptography.
--disable-hash
Builds Berkeley DB without support for the Hash access method.
--disable-heap
Builds Berkeley DB without support for the Heap access method.
--disable-queue
Builds Berkeley DB without support for the Queue access method.
--disable-partition
Builds Berkeley DB without support for the partitioning of databases.
--disable-replication
Builds Berkeley DB without support for the database environment replication.
--disable-statistics
Builds Berkeley DB without support for the statistics interfaces.
--disable-verify
Builds Berkeley DB without support for database verification.
--enable-stripped_messages

Strips message text from the error messages issued by Berkeley DB. This can reduce the size of the library by roughly another 22KB.

If your library has stripped messages, you can get an idea of what text should be issued for a given error message by using the Berkeley DB Message Reference Guide.

Note

--disable-cryptography and --enable-cryptography are deprecated in the Berkeley DB 11gR2 release. Use --with-cryptography=no and --with-cryptography=yes instead.

The following configuration options will increase the size of the Berkeley DB library dramatically and are only useful when debugging applications:

--enable-debug
Build Berkeley DB with symbols for debugging.
--enable-debug_rop
Build Berkeley DB with read-operation logging.
--enable-debug_wop
Build Berkeley DB with write-operation logging.
--enable-diagnostic
Build Berkeley DB with run-time debugging checks.

In addition, static libraries are usually smaller than shared libraries. By default Berkeley DB will build both shared and static libraries. To build only a static library, configure Berkeley DB with the Configuring Berkeley DB option.

The size of the Berkeley DB library varies depending on the compiler, machine architecture, and configuration options. As an estimate, production Berkeley DB libraries built with GNU gcc version 4.X compilers have footprints in the range of 600KB to 1.4MB on 32-bit x86 architectures, and in the range of 700KB to 1.6MB on 64-bit x86 architectures.

For assistance in further reducing the size of the Berkeley DB library, or in building small memory footprint libraries on other systems, please contact Berkeley DB support.