Knowledgebase

Managing Device Memory and Resources Print

  • internetthings, internet, errors, guide, howto, solution, zillionkinghost, hosting
  • 0

Working within tight limits.

WHAT MEMORY EXISTS

Program storage, holding firmware Volatile working memory, usually very small Persistent storage for configuration and buffers

WHAT CONSUMES WORKING MEMORY

Buffers for radio and sensors The stack Static variables

WHAT STACK OVERFLOW CAUSES

Corruption that appears as unrelated faults.

WHAT DETECTS IT

Filling the stack with a pattern and checking how much was used.

WHAT TO MEASURE

Peak usage, under worst-case conditions.

WHAT WORST CASE MEANS

Deepest call path, largest message, error handling active.

WHAT PERSISTENT STORAGE HAS

Limited write cycles.

WHY THAT MATTERS

Writing frequently wears it out within the device's intended life.

WHAT TO DO

Write rarely Distribute writes across the storage Buffer in memory and commit periodically

WHAT TO BE CAREFUL WITH

Power loss during a write, which corrupts.

WHAT PREVENTS THAT

Writing to an alternate location and switching, with a validity marker.

WHAT TO MONITOR IN THE FIELD

Free memory, reported periodically.

WHAT A DECLINING TREND INDICATES

A leak, which will eventually cause failure.

WHAT TO TEST

Behaviour when memory is exhausted, deliberately.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot