Disk cache: cap the free-space reserve at 10 GB, skip encodes the limit refuses

The reserve the cache leaves free on its disk was max(2 GB, 5% of the
disk) (#2551). On a 4 TB disk with 190 GB free that is 200 GB, so a
cache set to 20 GB had a limit of 0: every write was refused, the cache
never held anything, and only a log warning said so.

The reserve is now clamp(5% of the disk, 2 GB, 10 GB). It is there to
keep the cache from filling the disk, not to keep a share of a large
disk free: 10 GB leaves the system room to work on any disk, a small
disk still keeps 2 GB, and a 100 GB disk keeps 5 GB as before. After
Effects has only a maximum cache size and no reserve; a clamp keeps
the floor for small disks, where a fixed 10 GB would take most of the
space.

Writes the limit refuses cost no work: DiskCache::accepts_writes (one
atomic read) is checked before a frame is converted (put_disk_frame)
and before frames and layers are compressed (put_frame, put_frame_f16,
put_layer). The frame workers spent about 8 ms per frame and 14 ms per
layer on encodes that were then refused. persist_missing returns at
once at limit 0 instead of converting the RAM frames on every idle pass.

Settings > Disk shows the limit in effect in MB under Maximum Disk
Cache Size, with a note when free disk space lowers it
(settings.disk.cacheLimit).
This commit is contained in:
vangel76 committed 2026-11-07 23:27:17 +01:00
1 parent 250e52cdc3
commit 4295717ca7
5 files changed
+288 -17

No files matched your search

+5 -1
View File
@@ -142,7 +142,11 @@ Commands (CLI, MCP, control channel):
it supports it)
- `disk.diskCacheEnabled`, `disk.diskCacheMaxGb`, `disk.diskCacheFolder`: the persistent disk
cache of processed layers and frames (in the browser: frames in the Origin Private File System,
at most half the origin's quota; the folder setting does not apply there). The Disk page also
at most half the origin's quota; the folder setting does not apply there). On the desktop the
cache never fills its disk: it leaves 5% of the disk free, at least 2 GB and at most 10 GB, and
is smaller than `disk.diskCacheMaxGb` when free space requires it. The Disk page shows the limit
in effect in MB under Maximum Disk Cache Size, with a note when free disk space lowers it (at 0
nothing is written, and frames and layers are not compressed for it). The Disk page also
shows **Browser Storage** in the web app: usage and quota, persistent storage, Clear buttons
(`storage.info` / `storage.persist` / `storage.clear`, see [web.md](web.md))
- `disk.mediaCacheFolder`: audio waveform summaries kept between sessions (`Peaks/`)