Optimizing memory usage in Matter applications
You can use different approaches to optimizing the memory usage of your Matter application, both on the nRF Connect SDK side and in the Matter SDK.
See the Memory footprint optimization guide for information about how to reduce memory usage for the nRF Connect SDK generally and for specific subsystems in particular, including Bluetooth® LE, Matter, and Thread.
The Matter SDK, included in the nRF Connect SDK as one of the submodule repositories using a dedicated Matter fork, provides a custom mechanism for optimizing memory usage in a Matter application. This solution defines a series of logging modules, each of which is a logical section of code that is a source of log messages and can include one or more files. For the complete list of modules, see the Matter SDK’s LogModule enumeration.
You can reduce the memory usage of each of these modules in the following ways:
Define a custom logging level for each module by setting one of the Matter SDK logging levels (Error, Progress, Detail, or Automation) in
src/chip_project_config.h, located in your application’s directory. For example, the following snippet shows the Bluetooth LE module set to logging at the Detail level:
Turn off logging for any of the modules by setting its respective enabler to
0in the Matter SDK’s LogModule enumeration. For example, the following snippet shows the Bluetooth LE module cut off from logging its entries: