Loading...
Loading...
ROM/RAM memory usage analysis for embedded firmware: section breakdown, top consumers, and region budgets from compiled ELF binaries.
npx skill4agent add auroralabs-loci/loci-claude memory-reportasm-analyze command: <path><asm-analyze-cmd>venv python: <path><venv-python>plugin dir: <path><plugin-dir>system-reminderTarget: <target>, Compiler: <compiler>, Build: <build>
LOCI target: <loci_target>| LOCI target | CPU |
|---|---|
| aarch64 | A53 |
| armv7e-m | CortexM4 |
| armv6-m | CortexM0P |
| tc3xx | TC399 |
Supported: aarch64, armv7e-m, armv6-m, tc3xx-c.o.mapplace in [start-end]<asm-analyze-cmd> memmap --elf-path <binary> [--map-file <path.map>] [--top-n 10]<asm-analyze-cmd> memmap --elf-path <file.o>.o<asm-analyze-cmd> memmap --elf-path <new_binary> --comparing-elf-path <old_binary> [--map-file <path.map>]--elf-path--comparing-elf-path.o.o.o.prev-c-g--comparing-elf-path <path>--map-file <path>--top-n <N>mode: "report"sectionssummarytop_consumersmemory_regions--map-filemode: "delta"section_deltassummary_deltasymbol_deltasmemory_regions_delta--map-file## Memory Report: <binary_name>
Architecture: <arch>
ELF type: <executable | relocatable>
### Section Breakdown
Section Address Size Type Region
.text 0x08000000 14,832 B code ROM
.rodata 0x0800XXXX 2,048 B rodata ROM
.data 0x20000000 512 B data RAM
.bss 0x20000200 4,096 B bss RAM### ROM/RAM Summary
ROM total: 16,896 B (code: 14,832 rodata: 2,064)
RAM static total: 4,608 B (data: 512 bss: 4,096)### Top ROM Consumers (by size)
1. main 1,248 B (function)
2. process_data 896 B (function)
3. init_peripherals 784 B (function)
### Top RAM Consumers (by size)
1. rx_buffer 2,048 B (variable)
2. config 512 B (variable)### Memory Region Budgets
Region Used / Total Usage
FLASH 16,896 / 1,048,576 1.6%
RAM 4,608 / 131,072 3.5%
CCMRAM 0 / 65,536 0.0%## Memory Report: sensor_driver.o (relocatable)
Note: Addresses are zero-based (no linker placement).
Memory regions are not available for object files.
Section Size Type
.text 1,248 B code
.rodata 128 B rodata
.data 32 B data
.bss 256 B bss
ROM estimate: 1,376 B (code: 1,248 rodata: 128)
RAM estimate: 288 B (data: 32 bss: 256)## Memory Delta: old.elf -> new.elf
Architecture: cortexm
### Section Deltas
Section Before After Delta
.text 14,832 B 15,200 B +368 B (+2.5%)
.rodata 2,048 B 2,048 B 0 B (0.0%)
.data 512 B 640 B +128 B (+25.0%)
.bss 4,096 B 4,096 B 0 B (0.0%)
### Summary
ROM total: 16,880 B -> 17,248 B +368 B (+2.2%)
RAM static: 4,608 B -> 4,736 B +128 B (+2.8%)
### Top ROM Growth (by delta)
1. new_function +368 B (added)
2. process_data +128 B (896 -> 1024)
### Top RAM Growth (by delta)
1. new_buffer +128 B (added)## Memory Delta: driver.o.prev -> driver.o
Section Before After Delta
.text 896 B 1,024 B +128 B (+14.3%)
.bss 256 B 256 B 0 B (0.0%)
ROM estimate: +128 B (+14.3%)
RAM estimate: 0 B (0.0%)
### Changed Symbols
process_data: +128 B (896 -> 1024)### Memory Region Budget Delta
Region Before After Delta
FLASH 16,880 / 2,097,152 (0.8%) 17,248 / 2,097,152 (0.8%) +368 B
RAM 4,608 / 262,144 (1.8%) 4,736 / 262,144 (1.8%) +128 B<venv-python> <plugin-dir>/lib/loci_stats.py record --skill memory-report --functions <N> --mcp-calls 0 --co-reasoning 0<venv-python> <plugin-dir>/lib/loci_stats.py summary─── LOCI · memory-report ──────────────
<N> symbols (functions + variables) analyzed
<cumulative-summary-output> ← omit if empty
────────────────────────────────────────