For all targets except Arduino, to determine how much stack and heap your diagram uses when running on the target, select Embedded > your-target-device > Target Interface > Get Target Stack and Heap after running your diagram on the target in debug mode. If you have conditional subsystems, be sure to exercise all of them before executing this command to get an accurate stack usage report.