Caja - slow folder refresh

I am using Caja 1.24.0 under MATE 1.24 with Ubuntu 20.04 on an Intel laptop with 8GB RAM and ample SDD/HDD space.

When I am switching folders in the left side pane of Caja, often it takes time to display the folder info when I click on the folder.
This behavior is as if the folder contains many thousands of files and it is refreshing the file list before displaying. This seems to happen more often when I am switching across the same set of two folders. One folder contains about 2000 files (in 30 folders) and the other may be 20 files. Both folders are on an HDD partition with ample free space.

With such small number of files I am expecting Caja to instantly display the folder/files list whenever I click on the folder name. I checked if there are any settings but couldn't find any.

Any suggestions whether this is to be expected or why this might be happening?

Hi @arvindpmate :slight_smile:

This sounds like a tired HDD drive. Are you able to boot a live CD and try to navigate the same locations on the disk ?

Additionally, you can try to run a SMART test on your HDD :

Thank you for your response, @olek

The Smart test report (attached) says disk is OK but I see some worrying remarks in the Type column. Where could I see the exact meaning of those terms ("old-age, pre-fail").

The reason I raised this query with Caja is that another file manager Thunar v1.8.14 seems to work fine with the same folders.

That looks OK for the SMART test, no issue there - I have the same view with my brand new SSD.

I saw this bug, but I think it's not actual anymore.

What do you mean by slow ? How long it takes ?
Also, how this drives with slowness are mounted ?
Is the issue present also while browsing a system disk folder ?

How slow.... 3 to 5 seconds sometimes when it should take may be half second or even less. Not always but quite often.

Mounting - auto mounted by the system. My home folder is on the same HDD.

My system folder is on an SSD. I don't notice that slowness there but I rarely browse the system folders.

The bug pointed by you looks very similar. Although it seems closed, note the last two responses that are quite recent. And one of them is for Ubuntu Mate 20.04 !! :thinking:

Yap, maybe you can log that you are impacted by the same bug.

I saw that your SMART test report a 2 months uptime. Is there a way to stop your computer gracefully and start it again ?

One last question : what is the filesystem type of impacted volumes ? Same as system ext4 ?

I'm tempted to suggest nuking caja's caches, on the offchance that one of them is full of dreck.
Not difficult, and with no negative impact.

The only other thing that springs to mind is that if those folders are full of images, creating thumbnails for them can be very slow. (And not only pointless, but actively harmful). But that should be a one-time thing, so it doesn't sound like it fits.

1 Like

I do shutdown the laptop occasionally. But that seems to make no difference to that uptime value. Don't know why.

Filesystem - ext4

Thanks @arQon. The folders do contain hundreds of images. So I will now reduce the threshold of image size to min for thumbnails in preferences and check. Will also do apt-get clean to remove cache. Will report after a couple of days.

1 Like

This isn't the apt cache: it's caja's own cache (or possibly gvfs - I don't remember the details). I can't seem to find the thing on this machine, but one of my others had a TON of random cack in a cache dir somewhere - most of it for thumb drives etc that hadn't been connected in years - and wiping all of that seemed to help with caja's many problems, though obviously it did recreate the caches for the drives that still existed afterwards.

I'm guessing the thumbnailing is the root of the problem though, so you should be fine once you disable that.

One thing worth pointing out is that - for reasons that only the person who came up with the idea can answer - caja will create "thumbnails" for TEXT files as well. Despite the fact that such thumbnails can literally never provide anything of value at all. This is just a braindead leftover from the GNOME days, which should just be removed entirely, but if you don't disable that useless non-feature it'll also scan any files of THAT type as well, thus wasting even more IO and CPU.


1 Like

It's GVFS.

It's under your home directory, specifically in ~/.local/share/gvfs-metadata.

@arvindpmate, and after disabling all thumbnailing, delete the directory ~/.thumbnails in your home directory. This will get rid of existing thumbnails. (I deleted mine recently and discovered there were 25,864 thumbnails in that directory taking up a total of 36 MB of disk space!)


ty. As opposed to under ~/.cache, where it belongs, which is why I can never find the damn thing! :slight_smile:

@arvindpmate, and after disabling all thumbnailing, delete the directory ~/.thumbnails in your home directory. This will get rid of existing thumbnails. (I deleted mine recently and discovered there were 25,864 thumbnails in that directory taking up a total of 36 MB of disk space!)

I prefer to chmod -w it (after deleting all the files first, as you say). There's other software in the system that will also spam thumbnails in there, for no reason at all, and with no way to disable it even inside dconf etc. (eom is one, which I tracked down and submitted a patch for back when it was still eog, but of course it was rejected as NIH. sigh...)

1 Like

Thank you @gordon, @arQon. I have disabled all thumbnailing in Caja preferences. It seems to have made a difference immediately, but will watch what happens over the next few days and report.

~/.thumbnails is tiny (2MB) and seems to consist of mainly icon thumbnails etc. Not touching that for now.

`~/.local/share/gvfs-metadata' also is very small (7MB) but can't figure out what those files are. Not touching that too for now.

1 Like

Having disabled thumbnailing in caja I have seen much improvement in display speed for folders containing hundreds of image files.

But occasionally the issue reappears. I haven't detected a definite pattern in when this happens, but often it happens when I finish picture editing work in gimp and rawtherapee and would want to immediately transfer the processed files to the folder containing hundreds of images (I know this is not a very precise description of the pattern). I checked swap storage/free mem etc, but they seem ok (RAM 8GB Swap 18GB). The swap partition is on SSD. The gimp/RT processed image files are also not large, but both gimp and RT are flatpaks. I should try using gimp/rt from official Ubuntu repository sometime.

At the same time, Thunar seems to have no issues with any of this. It is happily performing including thumbnails..

I feel I should close this topic for now because the improvement in caja speed after disabling thumbnailing is good. Thank for your help.