Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fs: recreate kernelNodeIds & stableAttrs maps when they shrink
Maps do not free all memory when elements get deleted ( golang/go#20135 ). As a workaround, we recreate our two big maps (kernelNodeIds & stableAttrs) when they have shrunk dramatically (100 x smaller). Benchmarkung with loopback (go version go1.16.2 linux/amd64) shows: Before this change: Step VmRSS (kiB) ----- ----------- Fresh mount 4000 ls -R 500k files 271100 after drop_cache 336448 wait ~ 3 minutes 101588 After: Step VmRSS (kiB) ----- ----------- Fresh mount 4012 ls -R 500k files 271100 after drop_cache 31528 Results for gocryptfs are similar. Has survived xfstests via gocryptfs. Fixes: rfjakob/gocryptfs#569 Change-Id: Idcae1ab953270516735839a034d586717647b8db
- Loading branch information