<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>fds_gc() does not skip pages after first usage of FDS</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/58643/fds_gc-does-not-skip-pages-after-first-usage-of-fds</link><description>I&amp;#39;m trying to debug issues in my application related to FDS garbage collection. 
 My application periodically runs fds_gc() from startup. At this point, garbage collection is doing nothing. However, after I call pm_peer_rank_highest() once, fds_gc() appears</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 05 Mar 2020 18:15:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/58643/fds_gc-does-not-skip-pages-after-first-usage-of-fds" /><item><title>RE: fds_gc() does not skip pages after first usage of FDS</title><link>https://devzone.nordicsemi.com/thread/238396?ContentTypeID=1</link><pubDate>Thu, 05 Mar 2020 18:15:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b73b777c-4a83-48bb-a1fd-10c8d3e38297</guid><dc:creator>Elias</dc:creator><description>&lt;p&gt;I prefer to prevent non-NRF_SUCCESS return codes whenever possible. The fds_stat() strategy sounds like it will work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fds_gc() does not skip pages after first usage of FDS</title><link>https://devzone.nordicsemi.com/thread/238182?ContentTypeID=1</link><pubDate>Thu, 05 Mar 2020 08:11:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:00e0bb48-f6ae-4ab5-9357-d04bb2d0afa4</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="Elias Simon"]The consequence I was worried about was flash wear. I originally planned to have fds_gc() run once per minute, but this will go through the 10,000 write-erase cycles for flash in just under a week[/quote]
&lt;p&gt;To be honest I did not think of running GC that often. Why do you want to do that? Typically we recomend do run it when you get&amp;nbsp;FDS_ERR_NO_SPACE_IN_FLASH returned&amp;nbsp;when writing of updating a record (also if you get NRF_ERROR_STORAGE_FULL returned from certain peer manager calls, which uses FDS). This minimizes the number of garbage collection runs, saving power and reducing flash wear.&lt;/p&gt;
&lt;p&gt;Update: If you do not want to wait for the FDS to be full before doing GC, you can check the amount of free space using fds_stat() regularly, and make a desition on wheater to do GC based on that.&lt;/p&gt;
[quote user="Elias Simon"]Will this thread be updated once a fix is developed?[/quote]
&lt;p&gt;I cannot promise that this will be part of the next nRF5 SDK release, so it might take some time. I will try to remember updating this thread if/when it happens, though.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fds_gc() does not skip pages after first usage of FDS</title><link>https://devzone.nordicsemi.com/thread/238133?ContentTypeID=1</link><pubDate>Wed, 04 Mar 2020 18:26:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ef28ea6-0c75-41dc-87f8-62f1637c0b50</guid><dc:creator>Elias</dc:creator><description>&lt;p&gt;The consequence I was worried about was flash wear. I originally planned to have fds_gc() run once per minute, but this will go through the 10,000 write-erase cycles for flash in just under a week. Will this thread be updated once a fix is developed?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fds_gc() does not skip pages after first usage of FDS</title><link>https://devzone.nordicsemi.com/thread/238005?ContentTypeID=1</link><pubDate>Wed, 04 Mar 2020 11:45:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f00d2cd-569c-4084-8ca8-87c20554d36e</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thank you for reporting. It seems you are right that this is a bug. Referring to FDS from SDK 16, m_pages[page].can_gc is set to true on line 830 and 958 in fds.c. It is is also set on line 722, by the call to&amp;nbsp;page_scan() if a dirty record exists, but it is never set to false. I have reported it to the SDK team.&lt;/p&gt;
&lt;p&gt;I do not see this as a major bug though, and it should not have any significant consequences.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>