I came across this blog post which suggests half-million as suggested fs.inotify.max_user_watches value. But, I came to know that each watch consumes ~900 bytes (on 64-bit architecture). So, half-million watches implies ~400MB of memory (kernel memory), and kernel memory is not swappable.
I have few questions regarding this value:
Is this the optimal value of fs.inotify.max_user_watches?
Is inotify is recommended to watch half=million of handles/directories?
What happens if I specify a lower value than needed?
What happens if I dont use inotify at all?