How to estimate RAM requirements?

I have a basic prototype program running in Arm Development Studio. This needs to execute in a system with very limited resources.  How should I estimate the total RAM needed to run it?

It is a C++ program. How can I specify the maximum heap and stack sizes?

Best regards