Running Garbage collection Reuses the available flash?

Hi,

We are using nrf52840, with SDK 16.0. we wanted to know that How does Garbage collection works?!

Does it reuse the allocated pages by erasing it or it uses the new page?

Thank you,

Shreya

  • Hi Shreya,

    Does it reuse the allocated pages by erasing it or it uses the new page?

    Both. The FDS garbage collection algorithm works by copying records into erased/pages, and erasing to the old pages so that records are packed efficiently. See the FDS documetnation. This is doen by the help of the swap page (which moves around) every garbage collection. After gabage collection, all records are typically moved to different addresses, and the swap page has changed place. Dirty records (records marked for re-use becaue they have been deleted or updated), are discarded so that there will be more free spave availble after garbage collection.

Related