Repository navigation
Description
Version: ghcr.io/falcondev-oss/github-actions-cache-server:10.0.0 (multi-arch index
sha256:05c4d9e7169f525f2b74d412c4a081aeec5446a017ec88bae668e63ebfb16aa9), linux/amd64.
Configuration: STORAGE_DRIVER=filesystem, DB_DRIVER=sqlite, CACHE_MAX_SIZE_BYTES=256 GiB,
CACHE_CLEANUP_OLDER_THAN_DAYS=7, token validation on. Kubernetes (k3s), 1 replica.
What happens
The server's anonymous memory grows in proportion to the bytes clients upload, and it does not
come back down when the server is idle. At a 1 GiB container limit, the kernel OOM-killed it twice
in four days.
| Period (2026) | Uploaded | Anonymous memory |
|---|---|---|
| Nov 7 → Nov 9 | ~330 GB | 60 MB → 944 MB (OOM-killed) |
| Nov 9 → Nov 13 | ~220 GB | 220 MB → 832 MB (OOM-killed) |
That is about 2.8 MB per GB uploaded. Uploads came from actions/cache v4 and BuildKit's
type=gha cache, 25–224 GB a day.
The image runs mimalloc with MIMALLOC_PURGE_DELAY=0, so freed pages should go back to the OS
promptly. The memory appears to be live, not held by the allocator.
Reproduction
Run the same image in Docker with the filesystem driver and SQLite on a volume throttled to
40 MB/s (--device-write-bps). Each round uploads and then restores 9.4 GiB of entries. Idle
anonymous memory after rounds 1–4:
| Round | Idle anon after round |
|---|---|
| 1 | 157 MB |
| 2 | 161 MB |
| 3 | 180 MB |
| 4 | 209 MB |
That is about 1.4 MB per GiB retained. Upload errors under the throttle varied by round (1, 22
and 3).
With the same load on an unthrottled disk, memory levelled off at about 135–150 MB. The leak
therefore seems tied to slow storage, and possibly to failed or aborted uploads. In production,
the volume is a loop-mounted image on an HDD mirror, and the server's log shows slow SQLite
statements and 3–4 s connection waits.
Expected
Idle memory returns to a steady level after uploads finish, whatever the storage speed and
whether or not uploads fail.
Possibly related: #274 (closed; upload and download stream backpressure in v9.7/v9.8). The
v10.0.1 release notes list only a download-corruption fix, so this does not appear to be
addressed there.
Data available on request
/proc/<pid>/smapssampled every 15 min. It splits anonymous memory into the mimalloc arena and
other anonymous mappings, which may show whether the growth is in the Rust heap or in SQLite's
allocations.- The memory cgroup's
memory.statat each kill. - The repro script.
Workaround we run
A sidecar restarts the Deployment once resident memory passes half the limit, at a quiet hour,
when no transfer is in flight.
Activity
LouisHaftmann commentedon Nov 23, 2026
Thanks for the detailed report. I tried to reproduce this with the same setup (filesystem driver, SQLite, writes throttled to 40 MB/s with
--device-write-bps), but I couldn't get memory to grow without limit.The memory the server actually uses stays around 40–70 MB. mimalloc keeps another 100–130 MB on top of that, but in my runs that extra did not keep growing. Aborted uploads, many small entries, idle gaps between rounds and capacity-based eviction made no difference.
The throttled runs did reproduce the slow SQLite statements and connection waits from your logs. They also showed what caused your upload errors: uploads arrive faster than the disk writes them out, and every SQLite commit waits behind that backlog until the connection pool times out with a 500. #319 fixes that. The filesystem driver now writes each part to disk before confirming it, so uploads run at disk speed and the backlog stays bounded. This should also reduce the 3–4 s connection waits you see.
I don't have an explanation for the 944 MB yet. Your setup does a few things mine didn't: token validation is on, it runs for days, the traffic is real BuildKit traffic, and the server runs under a 1 GiB memory limit. Could you share:
/proc/<pid>/smapssamples, especially one near the start and one shortly before an OOM kill. They show whether the growth is in the mimalloc arena or in other anonymous mappings (for example SQLite's allocations).memory.statfrom one of the kills.MIMALLOC_PURGE_DELAYandMIMALLOC_ALLOW_THPare still set in the running container. They come from the image, so a Deployment that overrides the environment could drop them.