Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8330077

Allow max number of events to be buffered to be configurable to avoid OVERFLOW_EVENT

XMLWordPrintable

    • 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.


            bpb Brian Burkhalter
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: