To lower the module's RAM use, apply any of the following measures:
- Minimize the enabled data types: Disable the modules whose data you do not forward or store, for example with
CONFIG_APP_LOCATION=n. This reduces both the slabs and the RAM backend ring buffers, and it shrinksSTORAGE_MAX_DATA_SIZE. - Reduce the records per type: Set
CONFIG_APP_STORAGE_MAX_RECORDS_PER_TYPE=1when you do not need buffering. This shrinks both the per-type slabs and the RAM ring buffers to a single record each. - Shrink the batch pipe buffer: Set the
CONFIG_APP_STORAGE_BATCH_BUFFER_SIZEKconfig option to a lower value, for example from 1024 down to 256 bytes. If you use batch mode, make sure the buffer can still hold at least one item ofsizeof(header) + max_item_size. - Reduce the thread stack and the queues: Set the
CONFIG_APP_STORAGE_THREAD_STACK_SIZEKconfig option to a lower value, for example from 2048 down to 1024, if your application leaves headroom. You can also reduce the relevant zbus queue sizes in the system configuration if the traffic allows it. - Remove the development features: Disable the
CONFIG_APP_STORAGE_SHELLandCONFIG_APP_STORAGE_SHELL_STATSKconfig options to trim the RAM and code footprint. - Prefer the LittleFS backend when buffering many records: Use the LittleFS backend when you need a large
CONFIG_APP_STORAGE_MAX_RECORDS_PER_TYPEvalue, because the RAM backend allocates all ring buffers at boot, while the LittleFS backend only uses RAM for the records that are currently stored. - Use the ready-made Kconfig fragment: Use
overlay-storage-minimal.confto apply a minimal storage configuration with reduced RAM usage.