When you defragment a database each object is stored at a new location. To keep track which old id maps the which new location a IDMapper is uses. You can change the IDMapper or even implement your own.
By default the InMemoryIdMapping is uses, which is the fastest version, but consumes the most memory. As alterative there's the DatabaseIdMapping available, which stores mapping in a file and therefore uses less memory.
IIdMapping mapping = new InMemoryIdMapping(); DefragmentConfig config = new DefragmentConfig("database.db4o", "database.db4o.back", mapping); Defragment.Defrag(config);
Dim mapping As IIdMapping = New InMemoryIdMapping() Dim config As New DefragmentConfig("database.db4o", "database.db4o.back", mapping) Defragment.Defrag(config)