This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Why are the records getting dirty in fds example

I am trying to use the fds example provided in the sdk16, while viewing the debugging prints I see the following,

<info> app: Initializing fds...
<info> app: Event: FDS_EVT_INIT received (NRF_SUCCESS)
<info> app: Found 1 valid records.
<info> app: Found 41 dirty records (ready to be garbage collected).

Every time I restart the boot count is rightfully incremented and saved back on the flash also displayed in the debugging log. Why are the records getting dirty (and I need to run garbage collector).

Thank you

Parents
  • After going through fds functionality It seems that when a record is to be updated (fds_record_update), a new record is created and old record is invalided solely to prevent loss of data due to power loss in the middle of operation. A new record descriptor is returned for updated record.

    Thus frequent updates will consume flash space and its a good idea to clean it up using garbage collection.

    1. The size of record varies depending upon the data stored. What is the maximum data that can be stored after which garbage collection becomes necessary? Is it FDS_VIRTUAL_PAGE_SIZE  per page?

Reply
  • After going through fds functionality It seems that when a record is to be updated (fds_record_update), a new record is created and old record is invalided solely to prevent loss of data due to power loss in the middle of operation. A new record descriptor is returned for updated record.

    Thus frequent updates will consume flash space and its a good idea to clean it up using garbage collection.

    1. The size of record varies depending upon the data stored. What is the maximum data that can be stored after which garbage collection becomes necessary? Is it FDS_VIRTUAL_PAGE_SIZE  per page?

Children
No Data
Related