Does anyone know of a way to shrink/compact a db4o database?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
What do you mean by compact/shrink? Make an existing database smaller? Or do you want to compress the database?
One of roles for this is defragmentation. This frees up unused space in the database. When you delete objects, the database doesn’t shrink. Instead the space is marked as free for new objects. However overtime with a the manipulation of the database the file get fragmented. So defragmentation brings back unused space in the database.
When you store a lot of strings, you should consider using UTF8 encoding instead of default full unicode. This saves a lot of space, because a now a character uses only one byte.
Note that you cannot change this setting for existing databases! You need to defragment the database in order to change the string encoding.
To compress the database you could use a compressing storage-implementation. However I don’t know any available implementation which does this.