Memory usage on Synology NAS

Syncthing has been running fine for a long time on my DS218+ NAS. I am using the package 1.23.4-29 & the web interface says V1.29.2 Build 2025-01-12.

Last week I received a DSM out of memory and sure enough Syncthing is consuming all the RAM. Everytime I start the process it takes 85% of the RAM. If I stop the process RAM goes back to normal (around 15%)

I have a single folder which is about 8GB and is set for one way (send only) syncing and I am trying to sync the 4 remote machines. The folder seems stuck on scanning and the remote devices are all close to completion but stuck around 98%.

Because of the RAM being consumed all actions are very slow and the NAS is basically unusable. Any ideas of what this could be and how to debug? I don’t mind setting up everything from scratch but is there a way I can just prevent the process from consuming all the RAM (eg a config reset)?

Thanks

So how much memory does you synology have? My 1817+ only came with 2GB and it was marginal at best and very swappy… slow… I put 16GB in (the max) and it ran much better.

I used the docker variant and had control over the memory allocation but still 2GB is very limiting.

In the end I am syncing 1.3TB in 150k files with no problem on the synology with 16GB of RAM. It isn’t blazing fast (it’s a dual core Atom processor) but it works.

Just the standard amount 2GB. This is completely new behaviour. Even when idle it’s using 85% and DSM is unusable. I’ve been using Syncthing for years and this is the first time it’s run into this issue and it seems to have started just a few days ago. I am only syncing 8GB of data and maybe adding 20 small files per day.

Yeah. Not sure I can help. Only thing I would say is don’t discount other changes in your system. If something else is suddenly consuming an extra 100 or 200MB of ram that could put you over the edge if there was no margin.

I used the docker container. If you’re using the synology package I’m not sure if it’s possible to roll back to a previous version.

The problem lies squarely with Syncthing. I wiped the configuration completely (local folder on the NAS and the Remote machines) and started again from scratch. I added the local folder again. While it was indexing/syncing the folder the RAM usage was fine (no more than 33% usage). So far so good. I added one Remote client and it synced up without any issue. On the next scan of the local NAS folder, it got stuck at 49% and then the CPU on the NAS went to 86% and didn’t drop below this. I don’t know whether there is some file in that folder which is causing an issue but any situation where Syncthing gets stuck and uses this amount of RAM is a problem. I previous had an issue a few months prior with folders getting out of sync and needed to delete the remote folders and resync. I don’t know whether the community package ever gets updated but I can’t live with this sort of upheaval every time it breaks so I am going to abandon Syncthing and use another product.

Regarding the SynoCommunity package: It didn’t get updated in recent times because that wasn’t necessary. The included Syncthing executable keeps itself up to date through its internal update mechanism.

Sorry for your troubles with resource usage. I’m running it on a DS218j as well and didn’t encounter such problems. If you want to use something else, that’s fine. But if you want to diagnose the problem, we’ll need some debug profiles to find the cause. If it points toward a bug on Syncthing, then that should be fixed. But so far it’s impossible to say what’s at fault and how to fix it.

Thanks for your reply. The frustrating thing is that is has worked well for a long time. I am happy to send you debug logs. Please let me know what you want me to do and where to send the files.

https://docs.syncthing.net/users/profiling.html

I’ve got the files. Almost gave up on the heapdump since it took about 25 minutes. Shall I just post the files here or please let me know where to send. Thanks

@acolomb Saw a previous post where someone in support asked for the files to be uploaded here, so here you go

syncthing-heap-linux-amd64-v1.29.2-122232.pprof (22.8 KB) syncthing-heap-linux-amd64-v1.29.2-122227.pprof (22.2 KB)

syncthing-cpu-linux-amd64-v1.29.2-114342.pprof (7.6 KB) syncthing-cpu-linux-amd64-v1.29.2-114106.pprof (5.6 KB)

@calmh or @imsodin could you take a look at these dumps please?

Neither heap profile shows any significant memory usage (<30MB).

Appreciate you looking into this. I can still replicate the symptoms (the moment I start Syncthing up the memory usage is high on DSM and stays high ) and this is a new symptom. As mentioned before, I have completely wiped the config and started from scratch but the problem persists. The only thing I didn’t do it wipe the target directory. Is there anything else I can try before I call it?

I see the same here, so just a confirmation that this is not a singular case.