Ffirmwarekit EMBEDDED / DEVELOPER TOOLS
> tools / memory_lens

Firmware Memory Lens.

Inspect Flash and RAM, find large contributors, and compare builds.

Files stay on your device

01Input

Drop an ELF or GNU map file

Load both from the same build for exact sizes and object attribution.

ELF32 / ELF64 · either byte order · GNU ld maps · up to 256 MiB per build file.

02Settings

ELF / MAP

GNU map memory regions supply budgets automatically. Set usable Flash and RAM capacity for your target when needed.

Map symbol extents are estimates. ELF headers provide exact section and symbol sizes.

03Result

Open build files or load the example to begin.

Flash / image
—
Static RAM
—
—

Memory overview

Flash, runtime RAM, and the largest contributors.

Reading the result

Flash / image counts allocated file-backed section payload, including initialized RAM load copies. Static RAM includes initialized data, zero-initialized data, and declared reservations.

Section totals account for unnamed bytes. Symbol extents may overlap and are used for attribution, not added together as memory totals. Runtime heap peaks, call-chain stacks, and per-thread storage require measurement.

Use Load example to explore a synthetic STM32 GNU map. Import your linked ELF and matching map for your own build.

Link-time usage · runtime peaks need measurement

Memory footprint

Memory budgets

Usable capacity after bootloader and other reservations.

Blank means unknown. GNU maps supply MEMORY-region capacities automatically. Aggregate budgets do not replace checks for each bank.

How memory is counted

Flash / image

Allocated, file-backed section bytes at their load addresses. Initialized RAM sections can also consume image storage. Debug information and symbol tables are excluded. This is section payload, not the entire ELF file or a padded binary.

Static RAM

Runtime RAM sections, including initialized data, zero-initialized data, and declared stack or heap reservations. ELF flags provide a default split; GNU map MEMORY regions improve placement. Dynamic heap use, call-chain stack peaks, RTOS task stacks, and per-thread TLS copies need runtime measurement.

Exact sizes and estimates

ELF section and symbol sizes come from their headers. GNU map symbol sizes are inferred up to the next address within a contribution or output section; padding and aliases can be included. Symbol sums are never used as memory totals. Unnamed section bytes remain accounted for.

Region placement

Region use includes runtime sections and separate load copies, merging overlapping address ranges. Extent includes gaps from the region origin; section payload may understate the span of a raw binary. Region names and attributes classify Flash/RAM; unusual targets may need manual budgets and review.

Supported files

ELF32/ELF64 with either byte order and section headers, plus GNU ld maps. Files over 256 MiB and addresses beyond JavaScript’s exact integer range are rejected. IAR, Keil, and LLVM lld map formats are not supported. C++ names are shown as stored in the file.

Optimization hints

Hints identify candidates for inspection, not guaranteed savings. Size alone cannot tell whether code or data is unnecessary. Check behavior, timing, and runtime memory after changes.

Export analysis

Save the current analysis or the complete symbol list.

Reports include filenames and symbol names from your build. CSV cells that could be interpreted as formulas are escaped.