You are here: Configuration > File Configuration > Reserve Storage Space

Reserve Storage Space

Reserves a number of bytes in database files. Without this setting storage space will be allocated continuously as necessary.

The allocation of a fixed number of bytes at one time makes it more likely that the database will be stored in one chunk on the mass storage. This will result in less read/write head movement on disk based storage. Note: Allocated space will be lost on abnormal termination of the database engine (hardware crash, VM crash). A Defragment run will recover the lost space. For the best possible performance, this method should be called before the Defragment run to configure the allocation of storage space to be slightly greater than the anticipated database file size.

IEmbeddedConfiguration configuration = Db4oEmbedded.NewConfiguration();
configuration.File.ReserveStorageSpace = 1024 * 1024;
FileConfiguration.cs: Reserve storage space
Dim configuration As IEmbeddedConfiguration = Db4oEmbedded.NewConfiguration()
configuration.File.ReserveStorageSpace = 1024 * 1024
FileConfiguration.vb: Reserve storage space