Tumbler uses 140% CPU and exponentially growing amounts of memory when thunar watches folder with copying file(s)
Submitted by Öyvind Saether
Assigned to Ali Abdallah
Using XFCE4 4.13 on Fedora 29 and tumbler-0.2.3 I noticed that all the RAM was eaten when copying a 50 GB mkv video file with thunar. I can reproduce it.
- thunar open with a window showing a folder
- copy a really big video file into that folder
- watch tumbler use 140% CPU and exponential amounts of RAM, grows very quickly into the many gigabytes of memory not sure what it's doing but it would appear it wants to make a tumbnail of the changing partial file over and over and something goes wrong. No idea what.
I can reproduce this copying files from nfs to a local hdd and also copying files between local hdds. It easier to see the larger the files are, with a 10 GB video file it uses like 80% CPU and grows to something like 1 GB. With a 50 GB file it ate like 9 GB memory. That's enough to make ramlet's machnies have the oom killer kick in.
This does seem similar to the 2013 bug https://bugzilla.xfce.org/show_bug.cgi?id=9954
Tumbler start to get all resources available, including all CPUs (2 cores) and RAM. that sounds like the same issue except that it is isolated to a USB device and this seems to be a problem on all devices.
Ideally thunar should somehow detect big files that are changing/growing and leave them alone. The eats-all-your-RAM problem is a big one if it makes you run out of memory (I should not be seeing tumbler using 7 GB memory when copying a file regardless, though) but the IO load is also a bad thing since it probably slows down the copy process.
It's also worth mentioning that competing desktop environments have some setting which prevents files over some size from getting thumbnails generated. Not my preferred solution, though.