You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Excessive resource usage from case insensitivity filesystem layer #9836
After upgrading to v1.28.0, i am observing a rapid memory leak once Syncthing is started. It takes only a few minutes to fill all my 16GB of RAM. The issue also occurs on v1.28.1-rc.2. The issue does not occur on v1.27.12, that version only uses around 700MB of memory (RES).
I did not see any useful log messages.
Interestingly enough, the OOM killer on this Debian system does not trigger, and the system just stays unresponsive forever (or at least for 12+ hours).
Yes, run with --debug-profile-heap and Syncthing will create a series of heap profiles as usage grows. Grab the biggest/latest one and post it and we can maybe see what's going on.
The 2GB shown is still far away from the 8GB Syncthing ends up using, where it runs into the MemoryHigh=8G limit set by me and gets throttled. 2GB is still more than the memory usage on older versions, so this profile should already show the problem.
Can you post the configs from both sides please? Redacting any IDs and secrets as you like, I'm mostly interested in all the folder and device options as it seems there is a lot going on here.
I have a number of peers and folders, but pausing hosts and folders allowed me to narrow it down.
The causing folder has ~300k files. 200k of those are in one directory, unfortunately. On the local (memleaking) Syncthing node, it shows that a remote node is missing 100k elements. On the web interface of that remote node, only ~10 elements are actually shown as missing. The remote node is running Syncthing v1.27.2. When i downgrade the local node to 1.27, the missing 100k elements are still shown, but the number appears to go down.
Let me modify that, I don't know where this is coming from... In the general sense I can see that our fs caching for case insensitivity lookups is probably mostly ineffective in your setup (too few entries for too short a time), but the thing I thought was broken isn't. (I've written tests to try to prove brokenness, but it's not there.) I don't see why there would be a difference in 1.28 vs earlier releases.
I still don't see how the case caching/registry could do this, but it keeps coming up so I added some debug logging around it. If you can run tomorrows nightly build (otherwise next RC or release), could you repro with fs debug logging enabled and provide those logs please - that would then indicate if the registry is working as expected or not.
If #10430 fixes this issue, and the memory usage is from the DirNames calls themselves (which does seem to be the case for the heap profile mentioned in #9836 (comment)), then the title is not accurate, it's from to-be-cached dir names, not cached dir names.
changed the title [-]Excessive memory usage from cached dir names in v1.28.0[/-][+]Excessive memory usage from case insensitivity filesystem layer[/+]on Nov 5, 2025
changed the title [-]Excessive memory usage from case insensitivity filesystem layer[/-][+]Excessive resource usage from case insensitivity filesystem layer[/+]on Jun 25, 2026
Activity
calmh commentedon Nov 27, 2024
Yes, run with
--debug-profile-heapand Syncthing will create a series of heap profiles as usage grows. Grab the biggest/latest one and post it and we can maybe see what's going on.clonejo commentedon Nov 27, 2024
Oh, sorry, i missed that one in the
--help. Here you go:heap-337438.pprof.tar.gz
The 2GB shown is still far away from the 8GB Syncthing ends up using, where it runs into the
MemoryHigh=8Glimit set by me and gets throttled. 2GB is still more than the memory usage on older versions, so this profile should already show the problem.(profile taken on Syncthing v1.28.1-rc.2)
calmh commentedon Nov 27, 2024
Yeah, that's two gigs of cached dir names for the case insensitivity check.
This does seem a bit excessive.
[-]Memory leak in v1.28.0[/-][+]Excessive memory usage from cached dir names in v1.28.0[/+]calmh commentedon Nov 27, 2024
Can you post the configs from both sides please? Redacting any IDs and secrets as you like, I'm mostly interested in all the folder and device options as it seems there is a lot going on here.
clonejo commentedon Nov 27, 2024
I have a number of peers and folders, but pausing hosts and folders allowed me to narrow it down.
The causing folder has ~300k files. 200k of those are in one directory, unfortunately. On the local (memleaking) Syncthing node, it shows that a remote node is missing 100k elements. On the web interface of that remote node, only ~10 elements are actually shown as missing. The remote node is running Syncthing v1.27.2. When i downgrade the local node to 1.27, the missing 100k elements are still shown, but the number appears to go down.
Both nodes run on Linux amd64.
configs.tar.gz
Thanks for investigating!
calmh commentedon Nov 28, 2024
Yeah, OK, I see where this is coming from, thanks.
calmh commentedon Dec 1, 2024
Let me modify that, I don't know where this is coming from... In the general sense I can see that our fs caching for case insensitivity lookups is probably mostly ineffective in your setup (too few entries for too short a time), but the thing I thought was broken isn't. (I've written tests to try to prove brokenness, but it's not there.) I don't see why there would be a difference in 1.28 vs earlier releases.
imsodin commentedon Dec 16, 2024
I still don't see how the case caching/registry could do this, but it keeps coming up so I added some debug logging around it. If you can run tomorrows nightly build (otherwise next RC or release), could you repro with
fsdebug logging enabled and provide those logs please - that would then indicate if the registry is working as expected or not.fix(fs): store `getExpireAdd` mutex in `caseCache` (fixes syncthing#9836
marbens-arch commentedon Nov 5, 2025
If #10430 fixes this issue, and the memory usage is from the
DirNamescalls themselves (which does seem to be the case for the heap profile mentioned in #9836 (comment)), then the title is not accurate, it's from to-be-cached dir names, not cached dir names.[-]Excessive memory usage from cached dir names in v1.28.0[/-][+]Excessive memory usage from case insensitivity filesystem layer[/+][-]Excessive memory usage from case insensitivity filesystem layer[/-][+]Excessive resource usage from case insensitivity filesystem layer[/+]