Free up space rewrites a big game's whole store even when nothing is freed #133

Closed
opened 2026-10-25 06:09:24 -05:00 by ethan-hann · 0 comments
Owner

Measured on a copy of the GOG Cyberpunk 2077 install (5068 files, 91 GB in one streamed pack with its keep): Free up space with 0 Recently removed snapshots and nothing unreachable (the preview says nothing would be freed) still ran a full reclaim. It took 298 to 330 s, needed room for a second copy of the store, removed SavePoint's keep and merged the 90 GB streamed pack and a 613 MB pack into one 91 GB pack, leaving the store the same size. On a mid-range PC with a nearly full drive this can fail, and every Free up space press costs minutes for nothing.

Reclaim should only rewrite what it frees. Options to weigh: skip the repack when nothing is unreachable (a cheap reachability check over the kept packs' few objects, for example rev-list --objects --all against the objects each kept pack holds); keep the keeps through repack -a -d and only drop the keep of a kept pack that holds an unreachable object, so only that pack is rewritten; and make the preview and the job agree. Also note that IGamesApi.OptimizeStorageAsync is always a reclaim, so nothing can run a routine optimization on demand; decide whether that is intended (D28).

Measured on a copy of the GOG Cyberpunk 2077 install (5068 files, 91 GB in one streamed pack with its keep): Free up space with 0 Recently removed snapshots and nothing unreachable (the preview says nothing would be freed) still ran a full reclaim. It took 298 to 330 s, needed room for a second copy of the store, removed SavePoint's keep and merged the 90 GB streamed pack and a 613 MB pack into one 91 GB pack, leaving the store the same size. On a mid-range PC with a nearly full drive this can fail, and every Free up space press costs minutes for nothing. Reclaim should only rewrite what it frees. Options to weigh: skip the repack when nothing is unreachable (a cheap reachability check over the kept packs' few objects, for example `rev-list --objects --all` against the objects each kept pack holds); keep the keeps through `repack -a -d` and only drop the keep of a kept pack that holds an unreachable object, so only that pack is rewritten; and make the preview and the job agree. Also note that `IGamesApi.OptimizeStorageAsync` is always a reclaim, so nothing can run a routine optimization on demand; decide whether that is intended (D28).
ethan-hann added this to the 1.0 milestone 2026-10-25 06:09:24 -05:00
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ethan-hann/SavePoint#133
No description provided.