Skip to content

Reclaim trailing empty pages in blob store #165

@harrytmthy

Description

@harrytmthy

Background

Currently, when entries shrink or move between pages, trailing pages may remain empty but uncollected, leading to unnecessary file growth and memory-mapped region expansion. This impacts both disk space and RSS without providing functional benefits.

Goal

Reduce file size and memory footprint by trimming trailing unused pages.

Proposal

Introduce a post-write and post-delete check to detect and truncate trailing empty pages. If the last page (or consecutive pages at the end) has no live entries, unmap and remove it from memory, then truncate the underlying file. Ensure truncation triggers only after all pending writes complete to maintain mmap safety.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

Status
Ready

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions