Memory usage of a binary is reported by "readlef -l magiclantern"
under "MemSiz" field, and it's roughly equal to _bss_end -
RESTARTSTART. An example (this is a 50k autoexec.bin with a 200k
static array, which causes the camera to crash after taking a few
pictures):
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
LOAD 0x000054 0x0008b000 0x0008b000 0x0a0d8 0x4b5dc RWE 0x4
_bss_end - RESTARTSTART = 0x4B600 = 308736, compared to 308700 as
reported by readelf.
Attached you can find an interesting graph about how ML memory usage
evolved since my first 550D/1.0.9 build (12 december 2010, according
to bitbucket history).
ML builds with lowest memory usage were those from early January 2011
(just before upgrading to Terminus font). Highest memory usage were
before removing FONT_HUGE (2010 builds, which were unstable in photo
mode), and also in experimental builds with HDMI fixes (when at some
point I've noticed I can't change any more LCD backlight from Canon
menu).
The problem with wrong strings in menu seems to be a bug in gcc, and
not as a result of ML memory usage; the corrupted strings can be seen
by opening autoexec.bin in a hex editor.
Attached:
- the graph in plain text and PDF formats
- scripts which I've used to create it