Memory management

Asset Tracker Template

tags
Asset Tracker Template

This module allocates RAM from the following places, and understanding these helps you tune it down:

  • Built-in batch pipe buffer: CONFIG_APP_STORAGE_BATCH_BUFFER_SIZE bytes are reserved at boot.
  • RAM backend ring buffers: For each enabled data type, a ring buffer is declared with capacity sizeof(type) * CONFIG_APP_STORAGE_MAX_RECORDS_PER_TYPE.
  • Message buffers: struct storage_msg carries a buffer[STORAGE_MAX_DATA_SIZE], where STORAGE_MAX_DATA_SIZE is the max size of any enabled data type. Enabling large types increases this buffer and several temporary buffers.
  • Subscriber queue: Size is controlled by system zbus configuration.
  • Thread stack: CONFIG_APP_STORAGE_THREAD_STACK_SIZE.