Understanding stack/heap system stats

Hi all –

To get a better understanding of our system, we recently turned on Mbed statistics for heap, stack and cpu.

https://os.mbed.com/docs/mbed-os/v6.15/apis/mbed-statistics.html

Looking at the code, I’m not sure I understand the difference between current, max, total, reserved as seen here:

and here:

What does reserved mean in case of stack and heap? What about max?

Thanks a lof for your kind help :slight_smile:

Best,
– Ladislas

Okay, I think I’ve got the solutions.

Digging deeper into:

I’ve come to the conclusion that the naming is a bit misleading.

Regarding stack:

Regarding heap:

1 Like

Well actually, stack::max_size seems to really be max_size.

I wonder if it’s possible to have the current stack size.