This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 197966 - LinuxNotifier could watch many more dirs using extra file handles
Summary: LinuxNotifier could watch many more dirs using extra file handles
Status: RESOLVED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: Filesystems (show other bugs)
Version: 7.0
Hardware: PC Linux
: P3 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords: PERFORMANCE
Depends on: 185135
Blocks: 190675 26230
  Show dependency tree
 
Reported: 2011-04-21 19:49 UTC by Jesse Glick
Modified: 2011-05-09 10:55 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Multiple PollFd instances (8.09 KB, patch)
2011-04-25 16:13 UTC, Jaroslav Tulach
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2011-04-21 19:49:44 UTC
See bug #190675 comment #7. A major limitation of the Linux FS notifier using inotify is that Linux distributions typically set the fs.inotify.max_user_watches to 8192 by default, too small for watching a big tree. You can increase your limit manually but most people will not have done so.

One possible way around this limitation might be to cheat a little and open additional file handles when you run out of watches on the first handle. Would make the implementation more complex, but could greatly expand the limit.

Marking as a DEFECT since the current implementation does not even check the return value of inotify_add_watch - so if you run out of watches, the IDE will just silently not listen for additional changes, until some recursive listeners are removed.
Comment 1 Jaroslav Tulach 2011-04-25 11:57:01 UTC
Reporting errors during add_watch: ergonomics#74b0a4008588, making enhancement.
Comment 2 Jaroslav Tulach 2011-04-25 15:30:51 UTC
Calling select via JNA seems impossible (one cannot call FD_XXX macros). Using poll looks much easier.
Comment 3 Jaroslav Tulach 2011-04-25 16:13:44 UTC
Created attachment 107930 [details]
Multiple PollFd instances
Comment 4 Jaroslav Tulach 2011-04-25 16:16:25 UTC
Here is a patch that allocates new instances of inotify, but as soon as first one hits a limit, all of the new ones return -1/28 error too. Looks like the inotify limit is per user/process in spite what documentation says!?

If you can find out why the patch does not work for me, that would be great.
Comment 5 Jaroslav Tulach 2011-05-09 10:55:51 UTC
Looks like Jesse's suggestion does not work.