0

I am using Java FileWatcher nio package to watch for the file copying. My OS is Solaris 5. I am getting overflow event if file copy exceeds 500 numbers to the folder.

created /etc/sysctl.conf file and added below property. fs.inotify.max_user_watches=50000

Still I am getting overflow.How do I increase the number of events to be stored up?

FileWatcher Code:

for (WatchEvent<?> event: key.pollEvents()) {
    WatchEvent.Kind<?> kind = event.kind();

    // This key is registered only
    // for ENTRY_CREATE events,
    // but an OVERFLOW event can
    // occur regardless if events
    // are lost or discarded.
    if (kind == OVERFLOW) {
        continue;
    }
devv
  • 311
  • 5
  • 17
  • No idea, but why do you need to avoid OVERFLOW events in this particular case? There will always be a case where you could get an OVERFLOW event so you need to handle it correctly. – user253751 Jul 07 '16 at 04:21
  • My understanding is that it is event loss. I need to find newly copied files. So I have to send the JMS Message based on events. May I know ,how to handle this? – devv Jul 07 '16 at 10:27

0 Answers0