mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-06-13 23:36:45 +03:00
058569c77b
VidCache.cache was a []VidInfo indexed directly by volume id, so caching one volume with a large id grew the backing array to that many entries (each 48 bytes), allocating a zeroed slot for every unused id below it. A single id of 32M cost ~1.5GB resident, plus geometric realloc churn as the append loop doubled the array. Use map[uint32]VidInfo so memory scales with the number of volumes actually cached rather than the largest id seen. Parse ids with ParseUint(.,32) so values outside the uint32 volume-id range are rejected instead of silently wrapping into a key.