Information of peak RAM usage during runtime

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Information of peak RAM usage during runtime

Jump to solution
1,313 Views
arseniivanov
Contributor I

I was wondering if MCUExpresso IDE offers capabilities similar to other IDE's to calculate the Peak RAM usage during executing of code.

I have a situation where I am running a converted .tflite file, and would like to see how big arena needs to be allocated to fit the model. TFLM does not support this, and I am afraid that I am writing outside of the allowed memory as the allocator only seems to consider the input size.

Is there a feature which can tell the peak RAM usage during runtime?

0 Kudos
Reply
1 Solution
1,307 Views
ErichStyger
Specialist I

You can track dynamic memory usage including peak usage at runtime with this:

https://mcuoneclipse.com/2023/04/15/added-heap-memory-tracking-to-freertos-v10-5-1-using-systemview/

And there the 'Image Info' view which can be used for static memory: https://mcuoneclipse.com/2020/01/05/mcuxpresso-ide-v11-1-0/

If you are using FreeRTOS (which I assume), then there you have the stack watermark available: https://mcuoneclipse.com/2018/05/21/understanding-freertos-task-stack-usage-and-kernel-awarness-info...

Last but not least, you can use the following to determine heap and stack usage:

https://mcuoneclipse.com/2023/02/19/avoiding-stack-overflows-application-monitoring-the-stack-usage/

I hope this helps,

Erich

 

View solution in original post

2 Replies
1,308 Views
ErichStyger
Specialist I

You can track dynamic memory usage including peak usage at runtime with this:

https://mcuoneclipse.com/2023/04/15/added-heap-memory-tracking-to-freertos-v10-5-1-using-systemview/

And there the 'Image Info' view which can be used for static memory: https://mcuoneclipse.com/2020/01/05/mcuxpresso-ide-v11-1-0/

If you are using FreeRTOS (which I assume), then there you have the stack watermark available: https://mcuoneclipse.com/2018/05/21/understanding-freertos-task-stack-usage-and-kernel-awarness-info...

Last but not least, you can use the following to determine heap and stack usage:

https://mcuoneclipse.com/2023/02/19/avoiding-stack-overflows-application-monitoring-the-stack-usage/

I hope this helps,

Erich

 

1,298 Views
arseniivanov
Contributor I
This helps I think. Most of the memory is static and is pre-allocated, so the "Image Info" already provides a realistic ballpark for the build it seems, did not find this view before. Thank you.
0 Kudos
Reply