KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Unexpected Growth in Data File Size
PRODUCT: 4D | VERSION: 17 | PLATFORM: Mac & Win
Published On: December 27, 2019

If you have been noticing that your database's data file (.4DD) size has become unexpectedly large, it may be due to how 4D handles record deletion in regards to the data file. When a record is deleted, 4D does not remove the corresponding memory space in the data file, for optimization purposes. Instead, the space remains and can be overwritten by new records if their size is smaller than or equal to that space. If their size is greater, then a new memory space will be allocated on the data file, thus potentially resulting in a data file that contains several spaces that are the result of record deletions and leading to unexpected growth of the data file size.

For instance, suppose that your database has a table that keeps records of HTTP request logs. Old records may be constantly deleted while new records are being added, and the size of each record may vary. If one log of size 10 MB is deleted, while another log of size 15 MB is added, the net growth of the data file size may not necessarily be +5 MB. Since the added log is of greater size than the space for the log that was deleted, the net growth of the data file size may actually be +15 MB.

If you would like to try to avoid rapid growth of your data file, you may want to consider using external data storage. Please read more about it in the documentation here: https://doc.4d.com/4Dv15/4D/15.6/External-data-storage.300-3836657.en.html