1

Is there a limit to the number of FileWatchers supported by .NET, whether it be best performance practice or an actual windows limit?

I'm using the .NET MemoryCache class to cache of a library of some 15 000 small files. Each time a file is accessed, it's cached and I understand that the .NET MemoryCache (via CacheItemPolicy.ChangeMonitors) will create some sort of file watcher on it...

More info on the HostFileChangeMonitor created

When the HostFileChangeMonitor class is used in a non-ASP.NET application, the FileSystemWatcher class is used internally to monitor files. As a result, whatever access control list (ACL) applies to a monitored file or directory is applied to the Windows identity of the current thread.

dstj
  • 4,800
  • 2
  • 39
  • 61
  • I may be ignorant, but where does it say in the `MemoryCache` documentation that a `FileWatcher` is added to watch items in the cache? – xxbbcc May 02 '14 at 21:58
  • 1
    possible duplicate of [What are practical limits on the number of FileSystemWatcher instances a server can handle?](http://stackoverflow.com/questions/10195317/what-are-practical-limits-on-the-number-of-filesystemwatcher-instances-a-server) – Sheng Jiang 蒋晟 May 02 '14 at 23:52
  • I edited the question and will check the other question linked. Thanks. – dstj May 05 '14 at 13:28

0 Answers0