gvfs-sftp runs out of memory for large files
Running Ubuntu 22.04 LTS with GNOME 42.0, kernel version 5.15.0-30-generic.
System is a Intel® Core™ i5-4670K with 24GB of RAM installed.
When copying two large files (both ~30GB) from a SFTP remote source mounted via GNOME Files application to another location (in this case: a NFS share mounted via mount
in the console), gvfs-sftp
takes up multiple GBs of memory, and eventually gets killed by the OOM killer. This kills the SFTP connection and thus, the copy operation fails.
In case its relevant, the target NFS share is only reachable over a VPN connection, causing upload speed to be pretty shite thanks to slow upload speeds (only ~10Mbit/s available). This often causes stalling when dealing file operations on the target file system while the copy is running.
Logs from journalctl -b | grep gvfs
:
May 19 07:42:48 nils-desktop systemd-oomd[1865]: Killed /user.slice/user-1000.slice/user@1000.service/app.slice/gvfs-daemon.service due to memory used (22639853568) / total (25152270336) and swap used (1014124544) / total (1023406080) being more than 90.00%
May 19 07:42:48 nils-desktop systemd[3127]: gvfs-daemon.service: systemd-oomd killed 23 process(es) in this unit.
May 19 07:42:48 nils-desktop systemd[3127]: gvfs-daemon.service: Main process exited, code=killed, status=9/KILL
May 19 07:43:22 nils-desktop dbus-daemon[3141]: [session uid=1000 pid=3141] Activating via systemd: service name='org.gtk.vfs.Daemon' unit='gvfs-daemon.service' requested by ':1.5040' (uid=1000 pid=92609 comm="/usr/libexec/tracker-extract-3 " label="unconfined")
May 19 07:44:18 nils-desktop systemd[3127]: gvfs-daemon.service: State 'stop-sigterm' timed out. Killing.
May 19 07:44:18 nils-desktop systemd[3127]: gvfs-daemon.service: Killing process 6097 (gmain) with signal SIGKILL.
May 19 07:44:18 nils-desktop systemd[3127]: gvfs-daemon.service: Killing process 6344 (gmain) with signal SIGKILL.
May 19 07:45:18 nils-desktop nautilus[43148]: The peer-to-peer connection failed: Cache invalid, retry (internally handled). Falling back to the session bus. Your application is probably missing --filesystem=xdg-run/gvfsd privileges.
May 19 07:45:18 nils-desktop nautilus[43148]: The peer-to-peer connection failed: Cache invalid, retry (internally handled). Falling back to the session bus. Your application is probably missing --filesystem=xdg-run/gvfsd privileges.
May 19 07:45:19 nils-desktop systemd[3127]: gvfs-daemon.service: Failed with result 'signal'.
May 19 07:45:19 nils-desktop systemd[3127]: gvfs-daemon.service: Consumed 34min 4.405s CPU time.
May 19 07:45:19 nils-desktop gvfsd[92830]: fuse: failed to access mountpoint /run/user/1000/gvfs: Transport endpoint is not connected
May 19 07:47:44 nils-desktop gnome-system-monitor.desktop[93791]: glibtop(c=93791): [WARNING] statvfs '/run/user/1000/gvfs' failed: Transport endpoint is not connected
May 19 07:47:47 nils-desktop gnome-system-monitor.desktop[93791]: glibtop(c=93791): [WARNING] statvfs '/run/user/1000/gvfs' failed: Transport endpoint is not connected
Package versions installed:
gvfs-backends/jammy,now 1.48.1-4 amd64 [installed,automatic]
gvfs-common/jammy,jammy,now 1.48.1-4 all [installed,automatic]
gvfs-daemons/jammy,now 1.48.1-4 amd64 [installed,automatic]
gvfs-fuse/jammy,now 1.48.1-4 amd64 [installed,automatic]
gvfs-libs/jammy,now 1.48.1-4 amd64 [installed,automatic]
gvfs/jammy,now 1.48.1-4 amd64 [installed,automatic]