Additional projects

MCU Malloc Tracker

Heap leaks and allocation hotspots on an MCU are hard to reconstruct after a fault.

A diagnostic C library intercepts allocation calls, keeps static tracking tables and writes deterministic binary snapshots for offline decoding.

Stablev2.0.0MITC99
Last verified
Not audited against current README/docs
Platform scope
Portable C99; integration depends on caller-provided adapters

What it solves

Heap leaks and allocation hotspots on an MCU are hard to reconstruct after a fault.

How it works

1malloc/free/realloc2static tracker3binary snapshot4host decoder

Use it when

Find allocations that remain live
Identify frequently allocating call sites
Export heap state after a watchdog or hard fault

Quick Start

#include "mt_api.h"
mt_init();
void *buf=malloc(256);
uint8_t snapshot[2048];
size_t used=mt_snapshot_write(snapshot,sizeof snapshot);
/* Expected: used is the encoded snapshot length. */

Engineering evidence

  • Repository contains integration docs, examples, tests and snapshot decoder tooling

Known limits

  • The tracker observes heap use; it does not prevent fragmentation or leaks
  • Snapshot transport and retained storage are application responsibilities
  • Platform interception must be integrated correctly