-
Enhancement
-
Resolution: Fixed
-
P4
-
None
-
b22
-
generic
-
generic
ADDITIONAL SYSTEM INFORMATION :
Applies to all OSes, with Linux likely being the most common one on which the JVM-provided WatchService implementation is used.
A DESCRIPTION OF THE PROBLEM :
When using WatchService to watch a directory, the AbstractWatchKey#MAX_EVENT_LIST_SIZE constant (value: 512) makes it so that e.g. modifying 600 entries in a single watched directory inevitably results in an OVERFLOW event. Depending on the use case (e.g. watching the contents of a very large VCS repository), this hard-coded limit can be prohibitive.
Ideally, the hard limit could be replaced with a configurable system property. This would allow users of existing JVM-based applications to make file watching work at their scale without code changes. Since file system watching already requires tweaks to the local system (e.g. increasing inotify limits on Linux), having the end user control the limit matches existing patterns.
Applies to all OSes, with Linux likely being the most common one on which the JVM-provided WatchService implementation is used.
A DESCRIPTION OF THE PROBLEM :
When using WatchService to watch a directory, the AbstractWatchKey#MAX_EVENT_LIST_SIZE constant (value: 512) makes it so that e.g. modifying 600 entries in a single watched directory inevitably results in an OVERFLOW event. Depending on the use case (e.g. watching the contents of a very large VCS repository), this hard-coded limit can be prohibitive.
Ideally, the hard limit could be replaced with a configurable system property. This would allow users of existing JVM-based applications to make file watching work at their scale without code changes. Since file system watching already requires tweaks to the local system (e.g. increasing inotify limits on Linux), having the end user control the limit matches existing patterns.
- csr for
-
JDK-8331162 Allow max number of events to be buffered to be configurable to avoid OVERFLOW_EVENT
- Closed
- relates to
-
JDK-8332530 ENTRY_CREATE event not always emitted when copying file into the folder
- Closed