The defragmentation system uses db4o's transactional core to write the data to the new defragmented file. For large databases managing a long transaction can become an issue and can slow down the defragmentation. Therefore you can set a commit frequency. This means after the set number of processed objects the transaction is committed on the new file.
DefragmentConfig config = new DefragmentConfig("database.db4o");
config.ObjectCommitFrequency(10000);
Defragment.Defrag(config);
Dim config As New DefragmentConfig("database.db4o")
config.ObjectCommitFrequency(10000)
Defragment.Defrag(config)