View Single Post
Originally Posted by MarcinK View Post
Interesting, I just performed another sync on my desktop and watched my OF db grow to almost 600kb and drop back to 200kb. I guess this is just normal synchronization behaviour
Yes, the apparent size of the database can fluctuate quite a bit, and so can the actual size of the database. Here are some reasons why:

Your database is stored as a base file, containing all the state that all the clients agree upon, plus a bunch of little zip files corresponding to changes made since that point, approximately 1 zip file per change made. When all the clients are in sync, the next client to sync will compact the database, moving all changes more than an hour old into that base file and eliminating the little zip files that held them.

Because the database is stored as a bunch of files in a directory with a flag set to tell the Finder to treat it as one file (a package file), and because the filesystem allocates space in blocks which are typically larger than needed to hold these small zip files, as you accumulate a number of them, the size of that package reported by the Finder will grow rapidly, although the actual number of bytes in the package file may not. This doesn't matter much as far as the disk is concerned, but it does if you are copying the file across the network, where you are happy that you don't have to copy as much as it might appear at first glance, especially if you are using a slow cellular connection. So, if you really want an accurate view of the size of your database, look at the number of bytes reported by the Finder in parentheses, not the number of KB/MB/GB initially listed, which can be misleadingly large as it represents the maximum amount of data that could be stored in the disk blocks occupied.

In addition to the apparent size fluctuations, there can be some actual size fluctuations due to syncing. If you attach a file to an action or a project, perhaps an audio note from the iPhone, or a picture, or embed a document, that is a change that will occupy one or more zip files. If you then go and delete that attachment, it will remain in your database (even though it will appear to have been removed) until all of the clients are synced again and the transaction(s) adding, editing, and finally deleting that attachment have been compacted into the "past history" portion of the database. It is sort of like putting a file in the Trash, but not immediately emptying it, rather relying on someone else to do so at an unknown point in the future.

Zip files can accumulate in relatively large numbers if you are very active, and especially if you have a device which doesn't get synced very often (thus delaying compaction). If the number continues to grow, check the Show Clients display in the Sync preferences panel in the Mac application to see if you have a client that isn't being synced. Sometimes if you reinstall the app you'll end up with a registered client that is no longer active.