After many days of operation I am getting MALLOC_FAIL errors. How can I resolve?

A MALLOC_FAIL can occur for 2 reasons.

  1. There is no more space in RAM
  2. The heap is fragmented*

The latter can be resolved by calling reset() which will reset the module and defragment the heap. If there is enough contiguous memory freed up by the defragmentation, the issue is then resolved.

For the former, you will have to reconsider the use and scope of the variables and structures in your smartBASIC application.

*http://en.wikipedia.org/wiki/Fragmentation_(computing)

Categories

Products