Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

FDS Example - so what does "freeable words" actually mean?

Even immediately after issuing a gc (garbage collect) command, "freeable words" is still 1022:

fds example:~$ stat

total pages:    2
total records:  3
valid records:  1
dirty records:  2
largest contig: 1024
freeable words: 1031 (4124 bytes)
reserved words: 0
used     words: 2

fds example:~$ gc
<info> app: Event: FDS_EVT_GC received (FDS_SUCCESS)
fds example:~$ stat
total pages:    2
total records:  2
valid records:  1
dirty records:  1
largest contig: 1024
freeable words: 1022 (4088 bytes)
reserved words: 0
used     words: 2

fds example:~$

Why?

What does this number actually mean?

The documentation just says,

The largest number of words that can be reclaimed by garbage collection.

The actual amount of space freed by garbage collection might be less than this value if records are open while garbage collection is run.

But, even after doing delete all, and gc, it is still 1022:

fds example:~$ delete_all
<info> app: Deleting next record.
<info> app: Event: FDS_EVT_DEL_RECORD received (FDS_SUCCESS)
<info> app: Record ID:  0x0015
<info> app: File ID:    0xF010
<info> app: Record key: 0x7010
<info> app: Deleting next record.
<info> app: No records left to delete.
fds example:~$ gc
<info> app: Event: FDS_EVT_GC received (FDS_SUCCESS)
fds example:~$ stat
total pages:    2
total records:  1
valid records:  0
dirty records:  1
largest contig: 1024
freeable words: 1022 (4088 bytes)
reserved words: 0
used     words: 2
fds example:~$

Why?

If they are "freeable" - why does gc not free them??!

Parents
  • Hello,

    I was not able to reproduce the freeable words with the FDS example from SDK15. What SDK do you use? And do you use the project with or without the softdevice (is the path pca10040\s132 or pca10040\blank) ?

     

    Below is the log from the unmodified fds example from SDK15\examples\peripheral\flash_fds\pca10040\s132\...

     

    What operations did you do to get the large freeable words?

    It seems like freeable is suppose to say how many words that will be freed with a "gc".

     

    Best regards,

    Edvin

Reply
  • Hello,

    I was not able to reproduce the freeable words with the FDS example from SDK15. What SDK do you use? And do you use the project with or without the softdevice (is the path pca10040\s132 or pca10040\blank) ?

     

    Below is the log from the unmodified fds example from SDK15\examples\peripheral\flash_fds\pca10040\s132\...

     

    What operations did you do to get the large freeable words?

    It seems like freeable is suppose to say how many words that will be freed with a "gc".

     

    Best regards,

    Edvin

Children
Related