"out of memory" panics with large .stignore

This is not really a support request, but…

I have been doing some stress testing just for fun, and noticed that Syncthing crashes when .stignore is too large.

  1. With .stignore of 30 MB, Syncthing crashed immediately and took the whole Web browser with it.
  2. With .stignore of 4MB, Syncthing crashed, but the Web browser survived.

Is there any “sensible” file size limit recommended for .stignore :thinking:? If yes, then I think that it may be a good idea to put a little warning in the Docs. I can do it myself, but I would need to know the maximum allowed/recommended size first.

This surprises me somewhat, but it might just be that no one tried before. How much memory does it end up needing for a large ignore file, and what are your patterns like?

It seems to be Syncthing x86 hitting the 1.5 GB process limit in Windows. I am doing more testing right now, and with a ~71 MB .stignore file, Syncthing uses ~1 GB of RAM. However, as soon as I try to view the ignored patterns in the Web GUI, the RAM usage jumps up to 1.5 GB causing Syncthing to panic.

As for the ignore patterns themselves, I just generate them with

for /l %a in (1,1,10000000) do echo;%a

so the .stignore file is just a list of numbers:

1
2
3
4
(...)
10000000

I will try the same with Syncthing x64 later. As for now, the Web GUI seems to be the culprit though.

Interesting. The GUI asks for a list of ignore lines and interpreted patterns so that probably becomes 2-3 times the original ignore file that then needs to be json encoded, encrypted, whatnot. Still doesn’t really feel like a gig of ram to me so there’s probably some low hanging fruit here to optimize.