---
title: "Programs forget on exit"
---

> Documentation Index
> Fetch the complete documentation index at: https://example.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Programs forget on exit

An eBPF program runs to completion on one event and discards its 512-byte stack. It cannot call `malloc()` or keep ordinary global variables without a kernel data structure backing them.

To count packets, match request start to response end, or send telemetry to a daemon, hooks store everything inside [BPF maps](https://example.com/ebpf-field-guide/glossary/#bpf-maps).

> **Key idea:** eBPF code is stateless; BPF maps are the shared memory bus linking multiple hooks to each other and to user space.

Source: https://example.com/ebpf-field-guide/core-architecture/maps-and-data/stateless/index.mdx
