Why is rclone using swap?

Sorry for resurrecting the thread, but I'm seeing the same in my Rasperry Pi 4GB, and given how slow disk swap is in this device, it makes it a problem.

I'm using three mounts, all with the following options:

[Unit]
Description=GDrive-1
AssertPathIsDirectory=/mnt/GDrive-1
Wants=network-online.target
After=network-online.target

[Service]
Type=notify
User=pi
Group=pi
KillMode=none
ExecStart=/usr/bin/rclone mount \
        --config=/home/pi/.config/rclone/rclone.conf \
        --allow-other \
        --fast-list \
        --buffer-size=256M \
        --vfs-cache-mode=writes \
        --dir-cache-time=24h \
        --cache-dir=/mnt/2TB/rclone \
        GDrive-1-Crypt:/ /mnt/GDrive-1
ExecStop=/bin/fusermount -uz /mnt/GDrive-1
Restart=on-failure
RestartSec=5

[Install]
WantedBy=default.target

I've set vm.swappiness to 10. My system has around 1GB of ram usage after boot. Once rclone starts activity, I immediately see swap usage even though there still is plenty of ram available. This happens even with vm.swapiness set to 0.

After a few hours of uploading files on just one of the mounts, my usage looks like this:

             total        used        free      shared  buff/cache   available
Mem:          3.6Gi       2.1Gi        82Mi        41Mi       1.4Gi       1.3Gi
Swap:         3.6Gi       858Mi       2.8Gi

This doesn't seem to be that bad, but the problem lies on rclone constantly using swap, even though there is plenty of ram available. Not using swap brings up oom killer.

I've mitigated the issue by using zram-swap, however this is not ideal.

This topic is a full year old. Posting here is not constructive. A ton of things happen in rclone development over a year, so when a thread is this old then half of the specifics in it may not even relevant at all anymore. Nor at the posters very likely to still be here or remember what this discussion was about.

If you have questions in the same vein then please open your own thread - and link this old thread instead. I will help there.

Make a new pos rather than bumping a year old thread.

Your buffer is too big so each file takes 256M per file, which causes the swap.