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

  • Yes, it's SDK15 - and with SoftDevice S132.

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

    None - just built the project in SES, downloaded, and ran it.

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

    Well, yes:  that is what I thought it should mean - hence my puzzlement that it does not seem to mean that at all!

  • Did you write anything in putty before delete_all in the log that you posted in your initial post? If not, what have you changed in the project? Does it happen if you program an unmodified version of the project? You can try with a fresh unzipped version of the SDK as well, in case you have modified something outside the project folder. If it still happens, can you send me a .zip of your project folder, so that I can try to replicate it? 

     

    It doesn't happen when I flash the example, so I am curious why you get the large number on freeable words. 

     

    Best regards,

    Edvin

  • Where/how would I send it?

    I think it would be rather large to email...

Reply Children
Related