<?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>How to use Valgrind (or a similar tool) to profile your application fro memory leaks</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/7301/how-to-use-valgrind-or-a-similar-tool-to-profile-your-application-fro-memory-leaks</link><description>Hey everyone, 
 I&amp;#39;m developing an application using the PCA10001 board. After a while my app crashes. I think this is due to un-freed memory regions. When writing similar programs for linux I usually use Valgrind to profile my application and find memory</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 27 May 2015 16:46:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/7301/how-to-use-valgrind-or-a-similar-tool-to-profile-your-application-fro-memory-leaks" /><item><title>RE: How to use Valgrind (or a similar tool) to profile your application fro memory leaks</title><link>https://devzone.nordicsemi.com/thread/25813?ContentTypeID=1</link><pubDate>Wed, 27 May 2015 16:46:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d5cfad4d-6f5c-44d0-95cf-c31aee3c5d00</guid><dc:creator>maxpaynner</dc:creator><description>&lt;p&gt;I&amp;#39;ll try that thanks :(&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use Valgrind (or a similar tool) to profile your application fro memory leaks</title><link>https://devzone.nordicsemi.com/thread/25812?ContentTypeID=1</link><pubDate>Wed, 27 May 2015 16:40:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e126f30e-7396-4ae6-a267-bf836cfdccae</guid><dc:creator>Bill Siever</dc:creator><description>&lt;p&gt;This isn&amp;#39;t quite an answer, but a suggestion --- Perhaps you should consider avoiding dynamic memory if possible.  If you aren&amp;#39;t sure how to proceed, I&amp;#39;m sure members of this forum may have suggestions.&lt;/p&gt;
&lt;p&gt;Most embedded systems of this scale avoid the use of dynamic memory (due to a combination of factors, but the main three are: a) the limited memory available, b) the lack of a true OS/runtime to help manage the memory, and c) the run-time behavior of dynamic memory can be difficult to analyze, which makes it difficult to ensure the application will be suitably robust).&lt;/p&gt;
&lt;p&gt;If there is some reason you must use dynamic memory, an alternative to a memory profiler would be to add instrumentation code to every memory allocation/deallocation to try to spot problems. This isn&amp;#39;t quite the same as Valgrind, which also tracks access, but it may provide information that would help you spot the problem.  (Segger&amp;#39;s Real-Time Terminal is a handy tool for this type of debugging. See Vebjørn&amp;#39;s blog post &lt;a href="https://devzone.nordicsemi.com/tutorials/6/debugging-with-real-time-terminal/"&gt;devzone.nordicsemi.com/.../&lt;/a&gt; )&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>