The Linux inotify system has a few issues** and can be difficult to debug.
This app should hopefully help track down how many inotify watches, instances, and what files are being watched.
** https://code.visualstudio.com/docs/setup/linux#_visual-studio-code-is-unable-to-watch-for-file-changes-in-this-large-workspace-error-enospc
*** https://unix.stackexchange.com/questions/15509/whos-consuming-my-inotify-resources
$ make
Building _release/inotify-info...
---- inotify-info.cpp ----
---- lfqueue/lfqueue.c ----
Linking _release/inotify-info...
$ CFG=debug make
Building _debug/inotify-info...
---- inotify-info.cpp ----
---- lfqueue/lfqueue.c ----
Linking _debug/inotify-info...
$ _release/inotify-info
------------------------------------------------------------------------------
INotify Limits:
max_queued_events: 16384
max_user_instances: 128
max_user_watches: 65536
------------------------------------------------------------------------------
Pid App Watches Instances
2632 systemd 23 3
2653 pulseaudio 2 2
2656 dbus-daemon 2 1
2987 dbus-daemon 1 1
3056 xfsettingsd 56 1
3068 xfdesktop 10 1
3072 wrapper-2.0 6 1
3091 xfce4-clipman 1 1
3099 xiccd 1 1
3343 xfce4-terminal 1 1
3997 xfce4-appfinder 11 1
4048 xdg-desktop-portal 1 1
4086 xdg-desktop-portal-gtk 56 1
205668 vivaldi-bin 8 1
205705 vivaldi-bin 2 1
------------------------------------------------------------------------------
Total inotify Watches: 181
Total inotify Instances: 18
------------------------------------------------------------------------------
$ _release/inotify-info xfce4
------------------------------------------------------------------------------
INotify Limits:
max_queued_events: 16384
max_user_instances: 128
max_user_watches: 65536
------------------------------------------------------------------------------
Pid App Watches Instances
2632 systemd 23 3
2653 pulseaudio 2 2
2656 dbus-daemon 2 1
2987 dbus-daemon 1 1
3056 xfsettingsd 56 1
3068 xfdesktop 10 1
3072 wrapper-2.0 6 1
3091 xfce4-clipman 1 1
94111050 [10304h]
3099 xiccd 1 1
3343 xfce4-terminal 1 1
71048655 [10304h]
3997 xfce4-appfinder 11 1
94111468 [10304h] 15339430 [10304h] 14554799 [10304h] 70254617 [10304h] 70254684 [10304h] 16786993 [10304h] 14551253 [10304h] 14550430 [10304h] 70254647 [10304h] 70254646 [10304h]
92275589 [10304h]
4048 xdg-desktop-portal 1 1
4086 xdg-desktop-portal-gtk 56 1
205668 vivaldi-bin 8 1
205705 vivaldi-bin 2 1
------------------------------------------------------------------------------
Total inotify Watches: 181
Total inotify Instances: 18
------------------------------------------------------------------------------
Searching '/' for listed inodes... (8 threads)
14550430 [10304h] /usr/share/applications/
14551253 [10304h] /usr/local/share/
14554799 [10304h] /usr/share/xfce4/
15339430 [10304h] /usr/share/desktop-directories/
16786993 [10304h] /usr/share/xfce4/applications/
70254617 [10304h] /home/mikesart/.local/share/
70254646 [10304h] /home/mikesart/.config/menus/
70254647 [10304h] /home/mikesart/.config/menus/applications-merged/
70254684 [10304h] /home/mikesart/.local/share/applications/
71048655 [10304h] /home/mikesart/.config/xfce4/terminal/
92275589 [10304h] /etc/xdg/menus/
94111050 [10304h] /home/mikesart/.config/xfce4/panel/
94111468 [10304h] /home/mikesart/.cache/xfce4/xfce4-appfinder/
$ _release/inotify-info 3997
------------------------------------------------------------------------------
INotify Limits:
max_queued_events: 16384
max_user_instances: 128
max_user_watches: 65536
------------------------------------------------------------------------------
Pid App Watches Instances
2632 systemd 23 3
2653 pulseaudio 2 2
2656 dbus-daemon 2 1
2987 dbus-daemon 1 1
3056 xfsettingsd 56 1
3068 xfdesktop 10 1
3072 wrapper-2.0 6 1
3091 xfce4-clipman 1 1
3099 xiccd 1 1
3343 xfce4-terminal 1 1
3997 xfce4-appfinder 11 1
94111468 [10304h] 15339430 [10304h] 14554799 [10304h] 70254617 [10304h] 70254684 [10304h] 16786993 [10304h] 14551253 [10304h] 14550430 [10304h] 70254647 [10304h] 70254646 [10304h]
92275589 [10304h]
4048 xdg-desktop-portal 1 1
4086 xdg-desktop-portal-gtk 56 1
205668 vivaldi-bin 8 1
205705 vivaldi-bin 2 1
------------------------------------------------------------------------------
Total inotify Watches: 181
Total inotify Instances: 18
------------------------------------------------------------------------------
Searching '/' for listed inodes... (8 threads)
14550430 [10304h] /usr/share/applications/
14551253 [10304h] /usr/local/share/
14554799 [10304h] /usr/share/xfce4/
15339430 [10304h] /usr/share/desktop-directories/
16786993 [10304h] /usr/share/xfce4/applications/
70254617 [10304h] /home/mikesart/.local/share/
70254646 [10304h] /home/mikesart/.config/menus/
70254647 [10304h] /home/mikesart/.config/menus/applications-merged/
70254684 [10304h] /home/mikesart/.local/share/applications/
92275589 [10304h] /etc/xdg/menus/
94111468 [10304h] /home/mikesart/.cache/xfce4/xfce4-appfinder/
lfqueue is BSD-2-Clause License