The inotify API provides a mechanism for monitoring filesystem events. Inotify can be
used to monitor individual files, or to monitor directories. When a directory is
monitored, inotify will return events for the directory itself, and for files inside the
directory.
It's needed by both system and user-space applications that involve directories/files operations in order for those applications to know, confirm or fulfill their goal directories/files changes ... For example: APT when updating its cached packages information(i.e syncronizing) downloads compressed archives that it needs to wait until a close_write
event is reported on those archives indicating that they have finished downloading and it is safe to proceed to extracting them (this is particularly important when a multitude of those archives are downloaded in parallel for example).
Furthermore,
inotify (inode notify) is a Linux kernel subsystem created by
John McCutchan, which monitors changes to the filesystem, and reports
those changes to applications. It can be used to automatically update
directory views, reload configuration files, log changes, backup,
synchronize, and upload.
It need system resources to run and do its(singular form is for simplifying writing but those are actually multiple instances and multiple more watches) job … And being such a kernel subsystem and by nature makes it utilize, among other resources, the so called kernel memory which is a part of the total available system memory that is reserved for the kernel's use and kept off-limit from e.g. user-space applications and it is also limited in size ... Therefore, and out of necessity the usage of this kernel memory must be strictly managed not allowing a certain subsystem to overtake it and thus negatively affecting the system stability ... Hence, the limits imposed on inotify that you can view like so:
$ sysctl fs.inotify
fs.inotify.max_queued_events = 16384
`fs.inotify.max_user_instances` = 128
fs.inotify.max_user_watches = 65536
These limits can actually (safely in most cases) be increased if needed ... If you are seeing the error message indicating reaching the limit when you run a new application like in your case, then it's most likely that fs.inotify.max_user_instances
is the one that is causing this ... You can temporarily increase it to e.g. 256
like so:
sudo sysctl -w fs.inotify.max_user_instances=256
This will take effect immediately but will be reset after reboot ... It's advised for testing the stability of the system first ... If, however, you decide that you need that set permanently and survive reboots, then you can edit /etc/sysctl.conf
and add it as a new line like so:
fs.inotify.max_user_instances=256