How can I get the information about RAM use in CW

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

How can I get the information about RAM use in CW

4,514 Views
commandoccz
Contributor I
I want to know how many bytes of RAM I have been used in may program,Is it in the .map file?
Where the information located? Please tell me thanks
Labels (1)
0 Kudos
Reply
5 Replies

853 Views
commandoccz
Contributor I
This is my map file ,Can you tell me ,How many RAM I have used ,Thanks,I can not locate the place of  the information
0 Kudos
Reply

853 Views
peg
Senior Contributor IV
Hi commandoccz,

Here is the relevant section:

Summary of section sizes per section type:
READ_ONLY (R):         6EC (dec:     1772)
READ_WRITE (R/W):      112 (dec:      274)
NO_INIT (N/I):         18B (dec:      395)

The READ_WRITE bit.
Most of this is of course is the ALLOCATED stack space which bears no relation to the REQUIRED amount.

So your USAGE is 18 bytes plus however much is required by the deepest stack usage.

0 Kudos
Reply

853 Views
bigmac
Specialist III
Hello,
 
The RAM usage is slightly more than Peg has indicated.  The NO_INIT variables also use RAM.  So total RAM usage would be 669 bytes, including the allowance made for the stack.
 
Regards,
Mac
 
0 Kudos
Reply

853 Views
CompilerGuru
NXP Employee
NXP Employee
Actually no, the NO_INIT consists mostly of memory mapped registers, not of RAM.
What I usually look at is "OBJECT LIST SORTED BY ADDRESS" section, there the way the application uses the memory is most visible, and it is usually also apparent when things end up at the wrong spot...

The other lists are fine, but having the memory mapped registers in the listing hides the user part quite a bit :smileysad: Unfortunately, the there is nothing in the ELF format which would allow the linker to differentiate memory mapped registers with absolutely allocated variables (another :-().
Note that the READ_WRITE number contains basically all initialized variables, it does especially also include the zero initialized variables (.bss) (it does not include variables located in a NO_INIT or PAGED segment, and it does not include non initialized absolutely allocated globals).

Daniel

0 Kudos
Reply

853 Views
J2MEJediMaster
Specialist I
Yes, the info would be in the map file. For the HCS12(X) tools, you can find the size figures for ROM and RAM in the Module Statistic section of the map.

If you are using a different toolset, remember that we don't know what you're using until you inform us by mentioning the target MCU and the CodeWarrior version in the subject line of your post. Thank you.

---Tom



Message Edited by J2MEJediMaster on 2008-05-27 04:14 PM
0 Kudos
Reply