You are here: Tuning > Runtime Statistics > Monitor Freespace

Monitor Freespace

You can monitor the freespace-manager to find out more about the runtime behavior of your application.

Configure the Freespace Monitoring Support

To monitor the freespace manager you need to add the monitoring support to the db4o configuration.

configuration.Common.Add(new FreespaceMonitoringSupport());
FreespaceMonitoring.cs: Monitor the free-space system
configuration.Common.Add(New FreespaceMonitoringSupport())
FreespaceMonitoring.vb: Monitor the free-space system

The Freespace Statistics

average freespace slot size: Tells you how big the average slot is. When you store larger objects, they need larger slots to fit it.

reused freespace slots/sec: Tells you how many slots can be reused. When an object is deleted or modified, its old slot is released and can be reused. If you modify and delete a lot of objects, but the slots cannot be reused, then the database-file will fragment.

When this number is low but the free-space increases and increases then you have a fragmentation issue. Defragment your database. Use the btree-id-system.

number of freespace slots: Tells you how many slots are used by the database. As more and more objects are stored, the slot count will increase.

total freespace: Tells you how much freespace there is in the database-file.A hight free-space number with a low reused slots number indicates database fragmentation. Defragment your database. Use the btree-id-system.