v1.39.0: ~40 GiB anonymous memory charged to Dragonfly's cgroup but not mapped
ENVIRONMENT Dragonfly v1.39.0 (build 2026-06-07) OS Ubuntu 24.04.3 LTS, kernel 6.14.0-1021-gcp Platform GCP c3-highmem-22 — 22 vCPU, 172.94 GiB RAM, no swap Hosts one master + one replica, both affected Flags --cache_mode=true --dbnum=1 --maxmemory=163G --conn_use_incoming_cpu=true --timeout=300 --tcp_backlog=4096 Workload ~16.3M keys, avg value ~5.3 KB, 100% of keys carry a TTL very high expiry churn: 1.4B keys / 6.76 TiB expired in 12 days uptime
SUMMARY
On both hosts, the systemd cgroup for dragonfly.service is charged roughly 40 GiB
more anonymous memory than the Dragonfly process actually maps. free therefore
reports ~128 GiB used while Dragonfly's RSS is ~87 GiB. Dragonfly's own accounting
is internally consistent and healthy throughout (~6% used_memory-to-RSS overhead),
so this is not fragmentation inside Dragonfly.
We would like to understand whether this is expected behaviour, whether it relates to how Dragonfly/mimalloc releases memory after expiry, and what mitigation you recommend.
Source: dragonflydb/dragonfly