title: Determine total memory usage of embedded C program
body: <p>I would like to be able to debug how much total memory is being used by C program in a limited resource environment of 256 KB memory (currently I am testing in an emulator program).</p>
  
  <p>I have the ability to print debug statements to a screen, but what method should I use to calculate how much my C program is using (including globals, local variables [from perspective of my main function loop], the program code itself etc..)?</p>
  
  <p>A secondary aspect would be to display the location/ranges of specific variables as opposed to just their size.</p>
  
  <p>-Edit- The CPU is Hitachi SH2, I don't have an IDE that lets me put breakpoints into the program.</p>