The FSM is a metadata structure that tracks the free space available in each page of a table. PostgreSQL uses the FSM to avoid scanning the entire table when inserting new rows. When inserting, PostgreSQL first consults the FSM to find a suitable page with enough space.
The FSM is organized as a shallow tree: each node summarizes the free space in a subset of the pages, allowing PostgreSQL to quickly find candidate pages for inserts. After VACUUM operations, the FSM is updated to reflect newly freed space.
FSMs exist independently for each table or index. They are stored in separate files with the _fsm suffix and cover all pages across multiple file segments if the table exceeds the 1GB limit per file.