Appimage flashes, doesn't start when starting from a .desktop file. Uses up all the inotify

When I start Manager in Linux. It’s either using up thousands of inotify when I start from the command line.
Or when I start from a .desktop file it’s using up all of the inotify handles and doesn’t start, just flashes.

If anyone else is having this problem. In the .desktop file, the fix for me was to change Exec=… to
Exec=env DOTNET_USE_POLLING_FILE_WATCHER=1 Manager-x86_64.AppImage

To duplicate this problem start Manager with the below .desktop file. It’ll either flash endlessly or use up all the inotify handles.

[Desktop Entry]
Name=Manager
Exec=Manager-x86_64.AppImage
StartupWMClass=ManagerDesktop
Terminal=false
Icon=application-vnd.oasis.opendocument.chart
Type=Application

I am using Ubuntu 26.04

To see the amount of inotify handles it is using. Use the below to see that ManagerServer pid is using thousands of inotify when most apps use tens of them at the most.

find /proc/*/fd -lname anon_inode:inotify -printf '%hinfo/%f\n' 2>/dev/null | xargs grep -c '^inotify' | sort -n -t: -k2 -r

Or use this to count inotify: https://github.com/mikesart/inotify-info

Thank you for reporting this and for providing the workaround.

The following is a valid way to set the .NET polling variable from a .desktop launcher:

Exec=env DOTNET_USE_POLLING_FILE_WATCHER=1 /full/path/to/Manager-x86_64.AppImage

However, your example should use the full path to the AppImage. Exec=Manager-x86_64.AppImage works only if the file is in a directory included in the desktop session’s PATH. Otherwise, failure to start may be caused by the launcher not finding the AppImage, independently of the inotify issue.

A more complete launcher would therefore be:

[Desktop Entry]
Version=1.0
Name=Manager
Comment=Manager accounting software
Exec=env DOTNET_USE_POLLING_FILE_WATCHER=1 /home/username/Applications/Manager-x86_64.AppImage
TryExec=/home/username/Applications/Manager-x86_64.AppImage
Icon=/home/username/.local/share/icons/manager.png
Terminal=false
Type=Application
Categories=Office;Finance;
StartupWMClass=ManagerDesktop

The paths must be changed to the actual locations on your system. The AppImage must also be executable.

Please also check whether the workaround produces the same result when Manager is started directly from the terminal:

DOTNET_USE_POLLING_FILE_WATCHER=1 /full/path/to/Manager-x86_64.AppImage

That distinction is important. If the excessive inotify use also occurs when starting Manager normally from the terminal, and disappears when this variable is set, the issue is not specifically caused by the .desktop file. The .desktop file is then merely where you have applied the workaround.

The terminology that you use should also be corrected. The command you provided primarily counts “inotify watches” registered by processes, rather than “inotify handles” generally. Linux separately limits “inotify watches” and “inotify instances”. Please provide the output of:

cat /proc/sys/fs/inotify/max_user_watches
cat /proc/sys/fs/inotify/max_user_instances
cat /proc/sys/fs/inotify/max_queued_events

Please also state the Manager version. It would also be particularly useful to know the number of watches and whether the number reaches a stable level or continues increasing.

Your claim that most applications use only tens of watches should be removed. Applications that monitor complete directory trees can legitimately use hundreds or thousands. The issue here is whether Manager is unnecessarily monitoring a large number of paths or continually adding watches until the configured limit is reached!

The inotify-info utility is relevant for diagnosing this, but the report should contain the actual results rather than only linking to an external tool. In particular, identifying which directories ManagerServer is watching would help establish the underlying cause.

For now, DOTNET_USE_POLLING_FILE_WATCHER=1 appears to be a useful workaround on your installation. It does not yet establish that this is a general Ubuntu 26.04 problem or that launching Manager through a .desktop file is itself the cause.

Thanks for taking a look.

Starting v26.7.23.3657 from command line. 9749 in inotify-info

   Pid Uid        App                            Watches  Instances

1089172 1000 ManagerServer 9,749 2
6370 1000 xdg-desktop-portal-gnome 40 1
7073 1000 gsd-xsettings 40 1
7176 1000 xdg-desktop-portal-gtk 39 1
7086 1000 gvfsd-trash 33 2
6066 1000 update-notifier 19 1
989846 1000 nautilus 16 1
5882 1000 gnome-shell 16 1
7438 1000 snapd-desktop-integration 14 1
457021 1000 firefox 11 1
6350 1000 xdg-desktop-portal 11 1

Starting v26.7.23.3657 from .desktop file. 64053 in inotify-info

1091404 1000 ManagerServer 65,053 2
7073 1000 gsd-xsettings 40 1
6370 1000 xdg-desktop-portal-gnome 40 1
7176 1000 xdg-desktop-portal-gtk 39 1
7086 1000 gvfsd-trash 34 2
6066 1000 update-notifier 19 1
5882 1000 gnome-shell 16 1
989846 1000 nautilus 15 1
7438 1000 snapd-desktop-integration 14 1
6350 1000 xdg-desktop-portal 11 1
457021 1000 firefox 10 1

After starting it from the desktop file I can’t run anything else that uses inotify. It returns a out of inotify error.

The workaround works on both .desktop file and command line.

cat /proc/sys/fs/inotify/max_user_watches
65536

cat /proc/sys/fs/inotify/max_user_instances
128

cat /proc/sys/fs/inotify/max_queued_events
16384