Mbed OS stack and heap memory usage

Hi, is there a way to track the memory usage in mbed OS? I need this information to choose the optimal stack and heap size for my target.
Thank you

Hi,

ualloc contains tracking debug, please have a look at ualloc module, which has this code inside:

/*****************************************************************************************
UALLOC_DEBUG_LOG is effectively reserved for tracing memory allocations
Tracing must be enabled via "yotta config":
{
    "debug": {
        "options": {
            "memory-trace": true
        }
    }
}
[TODO]: ualloc_debug_level probably needs better control with "yotta config"
*****************************************************************************************/
#ifdef YOTTA_CFG_DEBUG_OPTIONS_MEMORY_TRACE
const UAllocDebug_t ualloc_debug_level = UALLOC_DEBUG_LOG;
#else
const UAllocDebug_t ualloc_debug_level = UALLOC_DEBUG_NONE;
#endif

Stack is used for static memory allocation and Heap for dynamic memory allocation, both stored in the computer’s RAM . More about…Stack and Heap

Brian