Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 8 Replies) Snazzier "Memory Usage Report" output (Read 12462 times)
CapnBry
Junior Member
**
Offline


Posts: 32
Joined: Nov 4th, 2011
Snazzier "Memory Usage Report" output
Oct 22nd, 2012 at 8:33pm
Print Post  
Because space is at a premium I am always experimenting with different ways of coding things to see which turns out smallest. The option to output the size information ("Memory Usage Report") at the end of the compile is nice but what would be even cooler would be to have a panel in visual studio which shows this information a little nicer like this for example:


This shows the output of `avr-objdump.exe -t (outputfile)` in a treeview so you can see how much space individual functions and data items are taking. The gray color indicates that the value is in BSS instead of initialized data, and of course this could look a little more polished. This is just a few minutes of throwing together an idea.

Quick and dirty source code PasteBin. Copyright "No rights reserved, free to use"

EDIT: Uses the TreeView with Columns control
« Last Edit: Oct 22nd, 2012 at 8:36pm by CapnBry »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Snazzier "Memory Usage Report" output
Reply #1 - Oct 22nd, 2012 at 9:33pm
Print Post  
That's excellent I can use that. maybe I should add it to the "Micro Explorer" as an option that you can run at any time after first compile.   

The std VS output windows are text only and I don't think you want it after every compile so moving it to the micro explorer is better?

I compared your Process code to mine and I had a .WaitForExit and was also attempting to RedirectStandardError. Dis-assembly works instantly now so will apply the same to other functions that use a Process as soon as I have time to test the changes.

Thanks very much for this.

  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Snazzier "Memory Usage Report" output
Reply #2 - Oct 22nd, 2012 at 9:36pm
Print Post  
The Tree View Columns project is also cool!
  
Back to top
WWW  
IP Logged
 
Marius
Developer
****
Offline


Posts: 204
Location: Centurion RSA
Joined: Sep 7th, 2011
Re: Snazzier "Memory Usage Report" output
Reply #3 - Oct 22nd, 2012 at 9:38pm
Print Post  
Tim
While you are looking at the Micro Explorer, how about adding a refresh function to it. If   you install new libraries, the ME does not pick it up.
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Snazzier "Memory Usage Report" output
Reply #4 - Oct 22nd, 2012 at 9:47pm
Print Post  
@Marius thanks for reminding me I knew that and forgot.

Can anyone tell me the difference between avr-size.exe and avr-objdump.exe? I'm using avr-size on the HEX at the moment to get the memory info. CapnBry is using avr-objdump

CapnBry, should i change it over?
« Last Edit: Oct 22nd, 2012 at 9:47pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
CapnBry
Junior Member
**
Offline


Posts: 32
Joined: Nov 4th, 2011
Re: Snazzier "Memory Usage Report" output
Reply #5 - Oct 22nd, 2012 at 10:41pm
Print Post  
Tim@Visual Micro wrote on Oct 22nd, 2012 at 9:47pm:

Can anyone tell me the difference between avr-size.exe and avr-objdump.exe? I'm using avr-size on the HEX at the moment to get the memory info. CapnBry is using avr-objdump

The difference is that avr-objdump only reports named symbols in the elf, you'll notice there's a discrepency between the text size reported in my demo and what what avr-size reports. For some reason avr-objdump also doesn't report the size of things which are just labels, e.g. the 100 byte vector table, or the static constructor area, bss and data initialization functions. The avr-size accurately represents what is going to be uploaded to the microcontroller because it just looks at where things end. My code also should include the size of data segment data in the progmem count, on account of them also residing in the program memory flash area.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Snazzier "Memory Usage Report" output
Reply #6 - Oct 22nd, 2012 at 10:43pm
Print Post  
Thanks for the info
  
Back to top
WWW  
IP Logged
 
danieldk
Junior Member
**
Offline


Posts: 11
Joined: Jun 18th, 2013
Re: Snazzier "Memory Usage Report" output
Reply #7 - Jun 19th, 2013 at 12:11pm
Print Post  
How can I add this view this on VS2012?

- specifically the function and variable size breakdown ( the disassembly view is too large to go through to find memory size culprits )
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Snazzier "Memory Usage Report" output
Reply #8 - Jun 19th, 2013 at 12:13pm
Print Post  
That one got forgotten, we will try to add it into the next release

Thanks for the reminder
  
Back to top
WWW  
IP Logged
 
danieldk
Junior Member
**
Offline


Posts: 11
Joined: Jun 18th, 2013
Re: Snazzier "Memory Usage Report" output
Reply #9 - Jun 19th, 2013 at 2:23pm
Print Post  
yay Smiley
  
Back to top
 
IP Logged
 
evorios
Newbies
*
Offline


Posts: 3
Location: Russia
Joined: Oct 28th, 2014
Re: Snazzier "Memory Usage Report" output
Reply #10 - Nov 26th, 2014 at 1:06pm
Print Post  
thanks for serializer
  
Back to top
 
IP Logged
 
evorios
Newbies
*
Offline


Posts: 3
Location: Russia
Joined: Oct 28th, 2014
Re: Snazzier "Memory Usage Report" output
Reply #11 - Nov 27th, 2014 at 10:19pm
Print Post  
I create new project for this utility on the github.
You may download binaries and source here:
https://github.com/evorios/avr_memusage/releases/tag/1.0.1
« Last Edit: Nov 27th, 2014 at 10:44pm by evorios »  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint