-
Minimize enabled data types
- Disable modules that you do not forward or store (for example,
CONFIG_APP_LOCATION=n), which reduces both slabs and RAM backend ring buffers and shrinksSTORAGE_MAX_DATA_SIZE.
- Disable modules that you do not forward or store (for example,
-
Reduce records per type
- Set
CONFIG_APP_STORAGE_MAX_RECORDS_PER_TYPE=1when buffering is not needed. This shrinks both the per-type slabs and RAM ring buffers to a single record each.
- Set
-
Shrink batch pipe buffer
- Set the
CONFIG_APP_STORAGE_BATCH_BUFFER_SIZEKconfig option to a lower value (for example, from 1024 down to 256 bytes), but ensure it can still hold at least one item ofsizeof(header) + max_item_sizeif you use batch mode.
- Set the
-
Reduce thread and 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. - Reduce the relevant zbus queue sizes in the system configuration if traffic allows.
- Set the
-
Remove development features
- Disable the
CONFIG_APP_STORAGE_SHELLandCONFIG_APP_STORAGE_SHELL_STATSKconfig option to trim RAM and code footprint.
- Disable the
-
Prefer the LittleFS backend when buffering many records
- Use the LittleFS backend when a large
CONFIG_APP_STORAGE_MAX_RECORDS_PER_TYPEvalue is needed, because the RAM backend allocates all ring buffers at boot, while the LittleFS backend only uses RAM for the currently stored records.
- Use the LittleFS backend when a large
-
Ready-made Kconfig fragment
- Use
overlay-storage-minimal.confto apply a minimal storage configuration with reduced RAM usage.
- Use