Two things we do to detect memory problems:
1 / Preventive measure: use Grammatech CodeSonar . As a static analyzer, it can detect a memory problem.
2 / Built-in control for stack control and heap usage .
3 / Globally, try not to use dynamic memory allocation, or at least limit the use of a new keyword when initializing the firmware. You will avoid heap fragmentation and memory problems.
source share