You can ask the object container for basic system information. Following information can be accessed:
long freeSpaceSize = container.Ext().SystemInfo().FreespaceSize(); Console.WriteLine("Freespace in bytes: {0}", freeSpaceSize);
Dim freeSpaceSize As Long = container.Ext().SystemInfo().FreespaceSize() Console.WriteLine("Freespace in bytes: {0}", freeSpaceSize)
Returns the freespace size in the database in bytes. When db4o stores modified objects, it allocates a new slot for it. During commit the old slot is freed. Free slots are collected in the freespace manager, so they can be reused for other objects.
This method returns a sum of the size of all free slots in the database file.
To reclaim freespace run Defragment.
int freeSpaceEntries = container.Ext().SystemInfo().FreespaceEntryCount(); Console.WriteLine("Freespace-entries count: {0}", freeSpaceEntries);
Dim freeSpaceEntries As Integer = container.Ext().SystemInfo().FreespaceEntryCount() Console.WriteLine("Freespace-entries count: {0}", freeSpaceEntries)
Returns the number of entries in the Freespace Manager.A high value for the number of freespace entries is an indication that the database is fragmented and that Defragment should be run.
long databaseSize = container.Ext().SystemInfo().TotalSize(); Console.WriteLine("Database size: {0}", databaseSize);
Dim databaseSize As Long = container.Ext().SystemInfo().TotalSize()
Returns the total size of the database on disk.