Xfce Forum

Sub domains
 

You are not logged in.

#1 2021-11-12 08:28:32

jack_the_pirate
Member
Registered: 2016-09-10
Posts: 59

Thunar using 100% of CPU - I am tired of this

Hello,

Thunar using 100% of CPU.

I am using XFCE for more than 10 years, mostly with Debian, but lately with Sparky (bleeding edge) and Opensuse (15.3: LTS).

And in every one of this distros the problem remains.

I've tried the usual solutions: disable thumbnails, etc, but still the problem arises everyday multiple times:
- I have a large disk with photos and videos of my kids
- and when I open a directory of that disk with Thunar
- in about some seconds or minutes
- the CPU goes to 100%
- and then I have to kill Thunar
- and open the directory again
- and the same thing happens
- I am tired of this
- and seriously thinking about changing from XFCE to another DE
- but, I like XFCE a lot
- and I am avoiding this move

Has somebody solve this problem for good?

Last edited by jack_the_pirate (2021-11-12 08:28:58)


Queen - Megadeth - Metallica - 80's

Offline

#2 2021-11-12 11:48:57

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 9,054

Re: Thunar using 100% of CPU - I am tired of this

Is it the thunar process that goes to 100%? Or maybe the tumblerd process?

Also, is there anything output to your ~/.xsession-errors file when this happens?

Offline

#3 2021-11-12 16:38:13

dusthillresident
Member
Registered: 2021-08-11
Posts: 24

Re: Thunar using 100% of CPU - I am tired of this

I'll bet it's tumblerd. for some years now Ive had to have a launcher on my panel that runs "killall tumblerd".

Offline

#4 2021-11-14 11:19:47

jack_the_pirate
Member
Registered: 2016-09-10
Posts: 59

Re: Thunar using 100% of CPU - I am tired of this

Hi,

As we are on a weekend, yesterday I spent some hours with many tests and I have found this:

It's not tumblerd, as you can see by these two screenshots:
https://imgbox.com/EITwUW0Y
https://imgbox.com/jz9wcVBM

I believe the problem is the plugin Directory Menu, but only when certain conditions are present.

I have three panels:
1 - horizontal panel with windows buttons, clock, etc
2 - vertical panel with many shortcuts and many Directory Menu entries
3 - a second vertical panel also with many shortcuts and many Directory Menu entries


Conditions for happening of Thunar high CPU:

1 - with Thunar (either using Directory Menu or not), enter a directory without write permissions (example: a different directory than Desktop or home folder, like /etc or /opt).

2 - then, with the plugin Directory Menu, enter a directory inside /my-data-partition/folder-1, as for example /my-data-partition/folder-1/folder-2.

3 - note: /my-data-partition is another ext4 partition (data partition) in my operative system disk.

4 - if I enter /my-data-partition/folder-1/folder-2 without using the plugin Directory Menu, the CPU doesn't go high and keeps normal.

5 - if I navigate away from the directory /my-data-partition/folder-1/folder-2 (even if I keep inside the current thunar window) and, for example, go to /my-data-partition/folder-1, the CPU stops from being at high utilization and returns to normal.

6 - curiously, if in first place I open a directory inside /my-data-partition/folder-1/folder-2 (wether or not using a Directory Menu entry in the panel) and then open it again (also wether or not using the plugin Directory Menu), the cpu doesn't go high and keeps normal.

7 - /my-data-partition/folder-1 has 777 permissions

8 - curiously, this doesn't happen in other directories, as for example: /my-data-partition/folder-3 or /my-data-partition/folder-3/folder-4 or /my-data-partition/folder-5 or /my-data-partition/folder-5/folder-6; it only happens in /my-data-partition/folder-1/folder-2; I couldn't find why, but maybe is because it has many files inside it (in some subfolders there are some are big video files and many photos, although as I said above it has 777 permissions.


I don't know if this is related to this bug, but I am using Thunar 1.8.15 and it was marked as solved in versions 1.6.16 and 1.8.3:
https://bugzilla.xfce.org/show_bug.cgi?id=14900



Point 4 above gave me a dirty workaround:
I just keep a Thunar window open (either using Directory Menu or not) in directory /my-data-partition/folder-1/folder-2 in another Workspace and this prevents the CPU from going because of Thunar.

This happened to me with Debian, CentOS, Sparky Linux, and now with OpenSuse, all with XFCE and Directory Menu (although these tests I made were only in OpenSuse 15.3 and Thunar 1.8.15).


So, I have two questions:
A - can somebody fix Directory Menu?
B - is there a Directory Menu alternative?


Queen - Megadeth - Metallica - 80's

Offline

#5 2021-11-14 16:20:14

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 9,054

Re: Thunar using 100% of CPU - I am tired of this

it only happens in /my-data-partition/folder-1/folder-2; I couldn't find why, but maybe is because it has many files inside it (in some subfolders there are some are big video files and many photos, although as I said above it has 777 permissions.

This is why I think its related to tumblerd/thumbnailing.


I can't seem to replicate this, but I don't have a directory with a large number of images. If you can replicate this, then go through it again and when the cpu spikes, run the following command in a terminal window:

pkill tumblerd

...and note whether there is an immediate drop in Thunar CPU usage.

Offline

#6 2021-11-14 18:40:02

jack_the_pirate
Member
Registered: 2016-09-10
Posts: 59

Re: Thunar using 100% of CPU - I am tired of this

Hi,

It is impossible to be tumblerd because I have uninstalled tumblerd some months ago.

If you take a look at my previous answer and also to this screenshots, you will see what is happening.

1 - just opening System Monitor
https://imgbox.com/bAcCGq1Z

2 - running "which tumblerd" gives nothing, because I have uninstalled tumblerd some months ago
https://imgbox.com/FkVgBRmx

3 - open directory /etc
https://imgbox.com/XNgkr73d

4 - open a directory inside /my-data-partition/folder-1 (/my-data-partition/folder-1/various/)
https://imgbox.com/6CzErwui

5 - running "pkill tumblerd" naturally gives no output
https://imgbox.com/gUSIINkU

6 - CPU continues very high
https://imgbox.com/STKgHoPE

7 - System Monitor ordered by CPU percentage usage shows us that Thunar is the process causing the high CPU
https://imgbox.com/Aju6gRKP

8 - System Monitor ordered by Process Name shows us all the running processes (Thunar is high, and there is no tumblerd)
https://imgbox.com/3qo9PFB5

9 - System Monitor ordered by Process Name page 2
https://imgbox.com/mN6svVdy


Queen - Megadeth - Metallica - 80's

Offline

#7 2021-11-14 19:42:02

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 9,054

Re: Thunar using 100% of CPU - I am tired of this

jack_the_pirate wrote:

It is impossible to be tumblerd because I have uninstalled tumblerd some months ago.

In that case, it can't  be tumblerd. There is also this bug report which looks possibly related.

Offline

#8 2021-11-14 22:05:44

CwF
Member
Registered: 2018-01-28
Posts: 214

Re: Thunar using 100% of CPU - I am tired of this

There are also some odd causes from hardware and/or source file corruption. This can be hard to determine, but thunar could be waiting on an i/o thrash. With kernels >5.2ish you could watch "pressure" at /proc/pressure/io. Make a genomon or something to cat the file. Normal operations should be zero.
Otherwise, I have had mpeg files (recording dvb) hang things, and usually timeout. This can show in this 'io' metric.

$  cat /proc/pressure/io
some avg10=0.00 avg60=0.00 avg300=0.00 total=64205479
full avg10=0.00 avg60=0.00 avg300=0.00 total=52643890

Offline

#9 2022-01-10 05:56:39

Signy
Member
Registered: 2020-10-20
Posts: 51

Re: Thunar using 100% of CPU - I am tired of this

I had similar problem with Thunar 4.15. I always have a lot of opened Thunar windows, some directories have a lot of files inside and I also use symlinks to directories (I even have directory A, which contains symlink to directory B, which contains symlink to directory A). BTW: I have a script, which goes through all Thunar windows and saves their opened directory, window geometry and workspace into a configuration file. And then it can open all the windows again.

I noticed Thunar (with companion process gvfs-metadata) used 30-60% of CPU and it happened quite often right after reboot (after all its windows are opened), sometimes once or twice in a day.
Usual help was killing Thunar and starting it again.
Sometimes when I restarted Thunar with the same windows, the problem went back immediately - so I assumed that it is somehow related to my directories (and thus it is not easy to replicate this behaviour somewhere else so I did not ask for help here).
I searched on the Internet for help (and followed advice like: "kill gvfs-metadata, remove some related directory") and nothing helped.

Out of despair I updated Thunar from this PPA (and then removed the PPA): https://launchpad.net/~xubuntu-dev/+arc … perimental

sudo add-apt-repository ppa:xubuntu-dev/experimental
sudo apt install thunar
sudo add-apt-repository --remove ppa:xubuntu-dev/experimental

and after couple of days it seems to be OK. This new Thunar has its own peculiarities, but the annoying CPU consumption stopped.

Offline

#10 2022-01-11 19:25:47

jack_the_pirate
Member
Registered: 2016-09-10
Posts: 59

Re: Thunar using 100% of CPU - I am tired of this

Signy wrote:

I had similar problem with Thunar 4.15. I always have a lot of opened Thunar windows, some directories have a lot of files inside and I also use symlinks to directories (I even have directory A, which contains symlink to directory B, which contains symlink to directory A). BTW: I have a script, which goes through all Thunar windows and saves their opened directory, window geometry and workspace into a configuration file. And then it can open all the windows again.

I noticed Thunar (with companion process gvfs-metadata) used 30-60% of CPU and it happened quite often right after reboot (after all its windows are opened), sometimes once or twice in a day.
Usual help was killing Thunar and starting it again.
Sometimes when I restarted Thunar with the same windows, the problem went back immediately - so I assumed that it is somehow related to my directories (and thus it is not easy to replicate this behaviour somewhere else so I did not ask for help here).
I searched on the Internet for help (and followed advice like: "kill gvfs-metadata, remove some related directory") and nothing helped.

Out of despair I updated Thunar from this PPA (and then removed the PPA): https://launchpad.net/~xubuntu-dev/+arc … perimental

sudo add-apt-repository ppa:xubuntu-dev/experimental
sudo apt install thunar
sudo add-apt-repository --remove ppa:xubuntu-dev/experimental

and after couple of days it seems to be OK. This new Thunar has its own peculiarities, but the annoying CPU consumption stopped.

Thank you!

By the way, can you share here your script?


Queen - Megadeth - Metallica - 80's

Offline

#11 2022-01-12 07:59:48

Signy
Member
Registered: 2020-10-20
Posts: 51

Re: Thunar using 100% of CPU - I am tired of this

jack_the_pirate wrote:

Thank you!
By the way, can you share here your script?

You are welcome, I am glad that it helped.

Well, my scripts are not well written, but they help me a lot. So you can try them, rewrite them or just inspire yourself for creating your own scripts. They are quite long, so I had to upload them on an external server, you can download them:

  • thunar_folders - main script,

  • mouse_switch - companion script, which is used to switch mouse off (and on) temporarily, while thunar_folders operates with Thunar windows (while it is saving current windows).

Those scripts use a lot of command line tools like: wmctrl, xdotool, zenity, xinput so it is highly unlikely they will work out of the box. Please check variable settings at the beginning of each script (=they need to be configured).
I am sure someone else could write better scripts, more efficient and elegant, I am still learning...

Offline

#12 2022-01-12 10:21:45

jack_the_pirate
Member
Registered: 2016-09-10
Posts: 59

Re: Thunar using 100% of CPU - I am tired of this

Signy wrote:
jack_the_pirate wrote:

Thank you!
By the way, can you share here your script?

You are welcome, I am glad that it helped.

Well, my scripts are not well written, but they help me a lot. So you can try them, rewrite them or just inspire yourself for creating your own scripts. They are quite long, so I had to upload them on an external server, you can download them:

  • thunar_folders - main script,

  • mouse_switch - companion script, which is used to switch mouse off (and on) temporarily, while thunar_folders operates with Thunar windows (while it is saving current windows).

Those scripts use a lot of command line tools like: wmctrl, xdotool, zenity, xinput so it is highly unlikely they will work out of the box. Please check variable settings at the beginning of each script (=they need to be configured).
I am sure someone else could write better scripts, more efficient and elegant, I am still learning...

Thank you!
And don't worry about the scripts not being perfect.
It's better than nothing.
I have lot's of scripts I've created myself and I believe most of them have mistakes or could be better.
Join the club smile


Queen - Megadeth - Metallica - 80's

Offline

#13 2022-01-12 15:21:44

Signy
Member
Registered: 2020-10-20
Posts: 51

Re: Thunar using 100% of CPU - I am tired of this

jack_the_pirate wrote:

Thank you!
And don't worry about the scripts not being perfect.
It's better than nothing.
I have lot's of scripts I've created myself and I believe most of them have mistakes or could be better.
Join the club smile

Thank you.
If you have any questions or notes what to improve, please let me know.

Offline

#14 2022-01-27 20:17:55

Danielsan
Member
Registered: 2017-11-22
Posts: 66

Re: Thunar using 100% of CPU - I am tired of this

Which kind of disk is it?

I suspect the culprit might be Fuse...


Debian ~ Devuan & FreeBSD + XFCE = <3

Offline

#15 2022-01-29 04:57:47

Signy
Member
Registered: 2020-10-20
Posts: 51

Re: Thunar using 100% of CPU - I am tired of this

Danielsan wrote:

Which kind of disk is it?

I suspect the culprit might be Fuse...

I am not sure if I understand your question...
From /etc/fstab:
I use 1 big SSD with ext4 partitions, 3 HDD with ext4 partitions:

UUID=9f6fe56b-c553-4759-9caf-133fd42f46	/mnt/XXXX	ext4	defaults,x-gvfs-hide,comment=gvfs-hide	0	0

+ couple of binds like this:

/mnt/XXXX/Apps			/media/Users/Apps	none	bind,x-gvfs-hide,comment=gvfs-hide	0 0

Offline

#16 2022-02-11 13:04:43

jack_the_pirate
Member
Registered: 2016-09-10
Posts: 59

Re: Thunar using 100% of CPU - I am tired of this

Danielsan wrote:

Which kind of disk is it?

It's a 3 Terabyte 3.5" hard drive


Danielsan wrote:

I suspect the culprit might be Fuse...

Could you elaborate on this and possible solutions?

Last edited by jack_the_pirate (2022-02-11 13:05:14)


Queen - Megadeth - Metallica - 80's

Offline

#17 2022-02-14 07:04:35

Danielsan
Member
Registered: 2017-11-22
Posts: 66

Re: Thunar using 100% of CPU - I am tired of this

Sorry guys, I made confusion, I was convinced those drives were external USB ones, hence I though that FUSE might be the issue. Every time I use fuse to load some samba folder or open and external drive the CPU explodes because FUSE...

Anyway I use MC when I have to copy/move a lot of files or big files...


Debian ~ Devuan & FreeBSD + XFCE = <3

Offline

Board footer

Powered by FluxBB