I made a few tests and thought I would share them, as quite a few discussions/reports are happening at the moment concerning resource usage. I did not get to the bottom of things, these are just some preliminary theories (thus might be totally wrong):
I am doing some mem intensive simulations at the moment and got an unexpected OOM - turns out Syncthing was using ~2GB memory (yes, it’s an old laptop). I noticed it was syncing a huge file then. So I did some testing syncing 1.1GB of random data, and the memory usage increased during the time of sync to ~1GB. Even weirded, after sync memory usage displayed in the UI didn’t drop down immediately, but very slowly. In htop it didn’t go back at all (RES, not VIRT). Suspecting the db, I set db tuning to small, but the same happened (starting from a lower base mem usage). And consecutive pprofs showed an increase im mem usage by protocol.BufferPool, but the full profile never accounted all the used memory. As we didn’t touch that code in quite some time, I am suspecting Go at the moment (I think there were significant changes in GC with 1.13). I’ll do some tests with older Go/Syncthing versions at some point (no time right now) to investigate this further.