Difference between (TOTALS) and .elf. Memory Usage Output

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Difference between (TOTALS) and .elf. Memory Usage Output

2,401 Views
codyhubman
Contributor III

Originally I thought that my .elf output for my memory represented the memory usage of my program. However, I found an option for TOTALS in my options menu... Not sure how I found it at this point but it's in there. Now when it debugs it skyrockets the amount for TOTALS as you can see below. I do know that my project is mostly under sample2.elf largely because the bss ram space consumed matched what I developed.

However this TOTALS has nearly 50kb of unaccounted for Flash (That I'm aware of being used). Anyone know what the issue is with this? I feel good about the 60kb of flash being used in sample2.elf but the 104kb makes the voice inside my head squeal a little. 

pastedImage_1.png

0 Kudos
Reply
6 Replies

2,223 Views
ErichStyger
Specialist I

Cody,

where did you find that option? And that last line with the .metadata seems wrong anyway (you won't link that file).

The GNU size tool (this is what is used in KDS) can be used to show the size for each file, see Listing Code and Data Size for each Source File with GNU and Eclipse | MCU on Eclipse 

But keep in mind that this will list the size of each file before it is linked, means the maximum size if you would use every function and every variable/object. The real size is less because the linker will remove any unused function/object variable.

If you are using a Kinetis device, I recommend you use the MCUXpresso IDE (MCUXpresso IDE V11.1.0 | MCU on Eclipse ) as it has a nice Image Info plugin which shows you the real size used in the binary.

I hope this helps,

Erich

0 Kudos
Reply

2,223 Views
codyhubman
Contributor III

I went through and found the option. Ill check out your article. We have MCU installed but I haven't played with it enough to get it working with my current project but I think I know why I was unable to get it working before. 

Here's where I found the option. 
pastedImage_1.png

0 Kudos
Reply

2,224 Views
ErichStyger
Specialist I

That's actually a very neat way using $(OBJS), appreciate that sharing and information!

0 Kudos
Reply

2,224 Views
codyhubman
Contributor III

Yeah, So I can see the total amount for each output file but I am at a loss for whatever TOTALS is talking about

0 Kudos
Reply

2,222 Views
ErichStyger
Specialist I

to me the TOTALS (--totals option) is just summing up all the values in the list?

2,222 Views
codyhubman
Contributor III

Oh ok, I was confused because in the past I didn't have Totals selected so I thought the sample.elf line was the "total" for my project and it seemed to be the amount of all the previous output files summed up together. So I was confused when I selected the totals option and it practically doubled the memory that said was being used. 

0 Kudos
Reply