RAM usage per folder and per connected device?

Is it possible to know exactly how much memory Syncthing is using per folder and per connected device? I have tried searching for more specific information, but I can only find older posts by @calmh basically stating that

There is a CPU and memory cost for every connected device

but I am curious how much exactly this cost can be.

I have tried measuring RAM usage myself, but because the usage keeps fluctuating depending on the current Syncthing’s activity, it is difficult to calculate the actual numbers. For example, I cannot really spot a visible different in memory usage between a configuration with only 2 devices, and another with 4 devices all connected with each other.

I don’t think it’s feasible to know exactly, there are various aspects at play here.

I understand that the exact numbers are relative, but for instance, if I have a folder shared between two devices with Syncthing using ~100 MB of RAM on each, and then add another device to the equation, so that the folder is now shared between all of them, how much of an increase in RAM usage should I expect?

You can’t answer that, as it depends if it has the same files, different files, recent version of files, old versions of files, how many ignored files it has, what version of syncthing is it running, etc.

Also, all of these things are uncorrelated to the database memory usage, as it depends what the database has been doing recently? Was it under write strain, hence has tons of stuff not flushed, have we traversed the database recently and filled it’s memory buffers, has nothing been happening and it’s completely settled with most of the memory freed?

The more data you have in the database, the more memory it will consume when going through it etc.

If you want a nonsense figure just for the purpose of having a figure. If you have no devices and your database is 100MB and 10MB of ram, assume that another device will be another 100MB and the same amount of ram.

1 Like

Thank you, although the numbers in my test configuration seem to be way lower than that, i.e. maybe 2-3 MB at most per device. I am going to do more testing in the future in a clean environment.

Idle uses very little memory. Memory gets used when scanning, transferring, or shuffling metadata. Then it depends on the actual data, number of folders, devices, etc. Maximum simultaneously active folders * devices is probably the better metric than just the static count of either.

1 Like