-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
samples: nrfcloud_multi_service: Decrease heap usage #15625
samples: nrfcloud_multi_service: Decrease heap usage #15625
Conversation
Test specificationCI/Jenkins/NRF
CI/Jenkins/integration
Detailed information of selected test modules Note: This message is automatically posted and updated by the CI |
You can find the documentation preview for this PR at this link. It will be updated about 10 minutes after the documentation build succeeds. Note: This comment is automatically posted by the Documentation Publishing GitHub Action. |
AFAIK we were already quite close to using the entire system heap under certain circumstances Did you test the following:
It may be necessary to reduce the message queue size in tandem with the system heap. And testing PGPS is a must Also note that this change will be completely incompatible with Wi-Fi scanning and with auto-onboarding, although I think that is likely unavoidable |
Perhaps we should reduce CONFIG_MAX_OUTGOING_MESSAGES if running out of heap is a problem. PGPS allocates a single 4KB block of RAM upon initialization. It does not allocate any from the heap otherwise. |
@@ -56,6 +56,20 @@ tests: | |||
- nrf9160dk/nrf9160/ns | |||
extra_args: EXTRA_CONF_FILE="overlay_coap.conf;overlay_min_coap.conf" | |||
tags: ci_build sysbuild | |||
sample.cellular.nrf_cloud_multi_service.coap.trace: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea to enable this.
Yep, that's what I meant might be necessary
Its possible I was simply mistaken when I wrote the comment Although hypothetically the memory use would be from MQTT messages sent/received in relation to PGPS. It looks like our CI actually does cover specifically the PGPS thing, so I think we can just update that comment and move along. But the device message queue size is still a concern. |
PGPS MQTT messages are quite small -- some parameters to the server and a hostname and path from the server. The majority of the data is received using HTTPS. |
@glarsennordic here are stats from running mss with the coap overlay -- it needed bytes of heap for 50 messages in the queue. 7936 - 4604 = 3332 consumed by 50 messages [00:20:09.334,533] message_queue: enqueue_device_message: Messages queue status: 0/50 |
@plskeggs Thanks for checking that. Then I would say there should not be any problem with this heap allocation change |
Actually, my bad, that was specifically with CoAP. I think it is with MQTT where we are much more likely to see a memory overflow |
OK, with MQTT, we run out of RAM at 44 messages in the queue. So, @jorgenmk, I recommend you reduce CONFIG_MAX_OUTGOING_MESSAGES to 25. |
Not enough RAM to build the coap + nrf_provisioning + modem_trace combination. Lowering heap usage to make space. Lowering MAX_OUTGOING_MESSAGES to fit new heap. Added twister build of trace configuration. Signed-off-by: Jorgen Kvalvaag <[email protected]>
ce50a06
to
e9357a0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Not enough RAM to build the coap + nrf_provisioning + modem_trace combination. Lowering heap usage to make space.