gvfsd-metadata seems to be hogging a lot of CPU time … why?
What is gvfsd-metadata
ps to the rescue?
$ ps aux | grep gvfs
pandfi 2315 0.0 0.0 192348 104 ? Sl Feb10 0:00 /usr/lib/gvfs/gvfsd
pandfi 5205 0.0 0.0 285952 2304 ? Sl Feb10 0:00 /usr/lib/gvfs/gvfs-udisks2-volume-monitor
pandfi 5210 0.0 0.0 281496 620 ? Sl Feb10 0:00 /usr/lib/gvfs/gvfs-afc-volume-monitor
pandfi 5215 0.0 0.0 199436 904 ? Sl Feb10 0:00 /usr/lib/gvfs/gvfs-gphoto2-volume-monitor
pandfi 5219 0.0 0.0 187272 720 ? Sl Feb10 0:00 /usr/lib/gvfs/gvfs-mtp-volume-monitor
pandfi 5236 4.8 0.0 126940 960 ? Dl Feb10 13:28 /usr/lib/gvfs/gvfsd-metadata
Right, so we know it’s a library. Which binary is calling it?
$ lsof | grep gvfsd-meta
gdbus 5236 5237 pandfi txt REG 252,0 77704 56230030 /usr/lib/gvfs/gvfsd-metadata
So, what’s gdbus? man tells us that gdbus is:
gdbus – Tool for working with D-Bus objects
Do we need to run gdbus?
So ultimately gdbus is responsible; “apt-file search gdbus | grep gdbus” tells us:
libglib2.0-bin: /usr/bin/gdbus
So we could try removing that package. Except lots of stuff depends on it, not least of which are software-center, ubuntu-settings, unity, lightdm, gdm, packagekit … Similarly for the gvsf-daemon packages. I found I was able to remove gvfs:amd64 and gvfs-backends, but not gvfs-daemons. In fact ia32-libs is one of the few things I have installed that really requires gvfs:i386 and gvfs-daemons.
An experiment, a suggestion
So, hum. Not wanting to get too bogged down I decided to “kill it with fire” and do
$ sudo chmod a-x /usr/bin/gdbus
Then kill all the gvfs based processes in your favourite way – I listed them using “ps aux | grep gvfs” and then did a “kill” with a list of the process numbers after it.
At first I thought this was preventing my file-manager, dolphin (KDE) from showing the file listings. But it was just slow to start. Nothing so far has broken, including Firefox. If there are problems then my next actions will be to reverse the above (“chmod a+x”) and then swap out gvfsd-metadata library for a blank file. I’ve read that deleting the gvfs metadata cache
$ rm -rf /home/user/.local/share/gvfs-metadata
is a fix for gvfs-metadata problems too.
Hope that helps. If it does, please comment to let others share the benefit of a working solution, thanks.
Bug reported at https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=773130