| com.db4o.config.FreespaceConfiguration
All known Subclasses: com.db4o.internal.Config4Impl,
Method Summary | |
public void | discardSmallerThan(int byteCount) tuning feature: configures the minimum size of free space slots in the database file
that are to be reused.
When objects are updated or deleted, the space previously occupied in the
database file is marked as "free", so it can be reused. | public void | freespaceFiller(FreespaceFiller freespaceFiller) Configure a way to overwrite freed space in the database file with custom
(for example: random) bytes. | public void | useBTreeSystem() configures db4o to use a BTree-based freespace system. | public void | useIndexSystem() configures db4o to use an index-based freespace system. | public void | useRamSystem() configures db4o to use a RAM-based freespace system. |
discardSmallerThan | public void discardSmallerThan(int byteCount)(Code) | | tuning feature: configures the minimum size of free space slots in the database file
that are to be reused.
When objects are updated or deleted, the space previously occupied in the
database file is marked as "free", so it can be reused. db4o maintains two lists
in RAM, sorted by address and by size. Adjacent entries are merged. After a large
number of updates or deletes have been executed, the lists can become large, causing
RAM consumption and performance loss for maintenance. With this method you can
specify an upper bound for the byte slot size to discard.
Pass Integer.MAX_VALUE to this method to discard all free slots for
the best possible startup time.
The downside of setting this value: Database files will necessarily grow faster.
Default value:
0 all space is reused
Parameters: byteCount - Slots with this size or smaller will be lost. |
freespaceFiller | public void freespaceFiller(FreespaceFiller freespaceFiller)(Code) | | Configure a way to overwrite freed space in the database file with custom
(for example: random) bytes. Will slow down I/O operation.
The value of this setting may be cached internally and can thus not be
reliably set after an object container has been opened.
Parameters: freespaceFiller - The freespace overwriting callback to use |
useBTreeSystem | public void useBTreeSystem()(Code) | | configures db4o to use a BTree-based freespace system.
Advantages
- ACID, no freespace is lost on abnormal system termination
- low memory consumption
Disadvantages
- slower than the RAM-based system, since freespace information
is written during every commit
|
useIndexSystem | public void useIndexSystem()(Code) | | configures db4o to use an index-based freespace system.
Advantages
- ACID, no freespace is lost on abnormal system termination
- low memory consumption
Disadvantages
- slower than the RAM-based system, since freespace information
is written during every commit
|
useRamSystem | public void useRamSystem()(Code) | | configures db4o to use a RAM-based freespace system.
Advantages
- best performance
Disadvantages
- upon abnormal system termination all freespace is lost
- memory consumption
|
|
|