Out of Memory(?) When Syncing with Joplin Server on Raspberry Pi

I'm running Joplin Server 2.7.4 on a Raspberry Pi 3 and everything is working well until I try syncing notes with some larger attachments (~200MB; I'm not sure exactly what size since I've not been very successful in finding out what file it is dying on). When I try to sync, it will eventually fail with an out of memory error for node (in the kern.log file). The Pi has 1GB of RAM and it seems like it is only using 50%-60% when it crashes. If it matters, I'm syncing from Windows on Joplin 2.7.15.
So, is there a good way to determine which file/note is causing the crash? I'm not seeing anything useful in the development tools console, but I may not be looking for the right things.
If node is running out of memory, is this a setting with node that is limiting memory usage (that could be tweaked) or do I need a Pi with more RAM?
Any help is appreciated. Thanks.

I think I can't really help with this one, but would you mind posting the exact error, node is giving you?

Kind regards

It is not node, per se, but the kernal. The error in question is:

Mar 26 08:43:53 raspberrypi kernel: [383685.133868] Out of memory: Killed process 8487 (node) total-vm:1263532kB, anon-rss:353340kB, file-rss:2016kB, shmem-rss:0kB, UID:1001 pgtables:980kB oom_score_adj:0

If you want a little more context, I have it, but this is what I'm seeing around each time that the sync doesn't go through.

Yes, indeed your Pi doesn't have enough ram. You can see the amount, node tried to write to ram here: total-vm:1263532kB, so roughly 1.3 GB. Before buying a new Raspi, you may want to try adding a swap Partition to your SD-Card to compensate a little bit more. But this method brings downside too, for example that SD-Cards are not made for applications like that, so they might fail quicker when you activate swap (that's the reason, why some applications for the pi use something called folder2ram, which actually writes temporary directories from the card to ram to reduce stress on the SD-Card). You could also plug in an external HDD for example and put a swap partition there.

1 Like

Thanks for that; I haven't thought about swap files in so long it didn't even occur to me to do anything with it. Upping the size of the swap file helped but I'm not sure I've found the root of the problem.

When I upped the swap file to 1GB, it still crashed with node taking ~1.6 GB. Upping it to 2GB hasn't crashed so far, but it also isn't syncing all of the files either. It seems to be burning through the CPU cycles and timing out that way. I've tracked down the files it isn't uploading and they are < 50MB, so I'm not sure what is making node take up that much memory for that kind of upload.

By the way is there some memory recomendations for Joplin server? Minimum value and something like "for each 1 MB in note you need X MB RAM for server"?

I tried the whole thing now and after a test run I didn't notice any ram consumption at all during sync...of course it could be that I'm testing wrongly...if I get time, I'll test it again later.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.