[ECOS] Total memory usage
Andrew Lunn
andrew.lunn@ascom.ch
Thu Jul 24 08:53:00 GMT 2003
On Thu, Jul 24, 2003 at 08:42:36AM +0000, eibach@gdsys.de wrote:
> Hello,
>
> is there an easy way to find out, how much memory is used by my ecos
> application?
>
> For sure I can go through the linker map file, but are there any
> tools for analyzing?
Depends on how you define total memory usage.
Try the size command:
$> arm-elf-size se45app
text data bss dec hex filename
1386028 55248 8073768 9515044 913024 se45app
Or objdump --headers
$ arm-elf-objdump --headers se45app
se45app: file format elf32-littlearm
Sections:
Idx Name Size VMA LMA File off Algn
0 .debug_aranges 0000be28 00000000 00000000 00167dfc 2**0
CONTENTS, READONLY, DEBUGGING
1 .debug_pubnames 00019bb6 00000000 00000000 00173c24 2**0
CONTENTS, READONLY, DEBUGGING
2 .debug_info 00aca5f9 00000000 00000000 0018d7da 2**0
CONTENTS, READONLY, DEBUGGING
3 .debug_abbrev 00053765 00000000 00000000 00c57dd3 2**0
CONTENTS, READONLY, DEBUGGING
4 .debug_line 0016727a 00000000 00000000 00cab538 2**0
CONTENTS, READONLY, DEBUGGING
5 .debug_frame 0002495c 00000000 00000000 00e127b4 2**2
CONTENTS, READONLY, DEBUGGING
6 .debug_str 0003e2f0 00000000 00000000 00e37110 2**0
CONTENTS, READONLY, DEBUGGING
7 .fixed_vectors 00000140 00000020 00000020 00e75400 2**5
CONTENTS, READONLY
8 .rom_vectors 00000040 00030000 00030000 00008000 2**0
CONTENTS, ALLOC, LOAD, READONLY, CODE
9 .text 0011a51c 00030040 00030040 00008040 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
10 .fini 00000000 0014a55c 0014a55c 00e75540 2**0
CONTENTS
11 .rodata 000380d0 0014a55c 0014a55c 0012255c 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
12 .rodata1 00000000 0018262c 0018262c 00e75540 2**0
CONTENTS
13 .fixup 00000000 0018262c 0018262c 00e75540 2**0
CONTENTS
14 .gcc_except_table 0000003c 0018262c 0018262c 0015a62c 2**2
CONTENTS, ALLOC, LOAD, DATA
15 .data 0000d794 00182668 00182668 0015a668 2**2
CONTENTS, ALLOC, LOAD, DATA
16 .bss 007b3228 0018fdfc 0018fdfc 00167dfc 2**5
ALLOC
17 .debug_ranges 00006898 00000000 00000000 00e75540 2**0
CONTENTS, READONLY, DEBUGGING
You need to parse the above and work out what really goes into memory
and what is left out, eg debug symbols etc.
None of these methods show you the heap usage. So depending on how you
define "total memory", as the subject of your email says, these
answers might not be what you want.
Andrew
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss
More information about the Ecos-discuss
mailing list