FmemoryFootprint
Bun

function

unsafe.memoryFootprint

function memoryFootprint(): undefined | number;

Accurate per-process memory footprint in bytes.

Unlike process.memoryUsage.rss(), this excludes pages already returned to the OS that the kernel keeps mapped lazily (Darwin's MADV_FREE_REUSABLE), so leak tests are platform-comparable.

Backed by task_info(TASK_VM_INFO).phys_footprint on Darwin, Pss: from /proc/self/smaps_rollup on Linux, and PrivateUsage on Windows. Returns undefined on platforms with no accurate accessor; callers should fall back: Bun.unsafe.memoryFootprint() ?? process.memoryUsage.rss().