How to read memory usage compile data

isaacjacobson

Well-known member
How exactly does one read the memory usuage compile data for Teensy?

Code:
[COLOR="#B22222"]Memory Usage on Teensy MicroMod:
  FLASH: code:164080, data:33808, headers:8956   free for files:16308228
   RAM1: variables:47424, code:161560, padding:2280   free for local variables:313024
   RAM2: variables:18112  free for malloc/new:506176[/COLOR]

I'm specifically trying to figure out how much RAM I have available. Is that displayed in this information?

Are the numbers displayed in bits or bytes?
 
Yes, the line: RAM1: variables:47424, code:161560, padding:2280 free for local variables:313024

Shows the static allocations for the resultant binary.

More info on T_4.x memory is at: pjrc.com/store/teensy41.html#memory

RAM1 holds all 'code:164080' not kept/executed in FLASH in 32KB blocks of ITCM portion of the RAM1's 512KB - where 'padding:2280' is the remainder of a 32KB block not holding actual code. The remainder of RAM1 is DTCM for 'variables:47424' initialized or other 'reserved' memory (not run time allocated) in this case leaving 'free for local variables:313024'

RAM1 runs at full processor speed.
 
Thanks, that helps a ton!

The one thing I haven't been able to find out: is "313024" is bytes or bits? Aka – how many KB is 313024?
 
What is the size of RAM1 before any compilation.
I think that if you add all the memory usage together you will find that it's obviously bytes.
 
I think that if you add all the memory usage together you will find that it's obviously bytes.

Yeah, you'r right – I just needed someone smarter than me to confirm. Following the link, RAM1 was labeled 512K (not b or B), so the extra confirmation was helpful. Knowing more about all the conversions would have helped me figure it out myself, but I just didn't know for 100% after my reading and research.

Thanks!
 
Indeed, the build output doesn't indicate Bytes - though that is the implied typical measure. And the linked page is sparse with the word BYTE as well and shows 'K' without a 'B' indicator.
 
Back
Top