Phillip Dixon

Obscure things, but they interest me.

Tracking RAM Usage

Working on embedded projects sooner or later RAM becomes an issue. Then it’s a matter of going through the heavy RAM consumers and seeing what can be squeezed.

I knocked up the following help today while I was tracking down what was using the RAM on my current project.


arm-none-eabi-nm -S -t d --size-sort $1 | \\
awk '{if ($3 ~ /B|b|D|d/) {print $0; total += $2}} END{print "Total RAM Usage: " total}'