Your FileSystemWatcher component has the potential to receive an enormous number of events, particularly if you have set it to watch a very high-traffic directory. This can cause problems, as the FileSystemWatcher component uses an internal buffer of limited size to store the events. If too many changes occur, this buffer might overflow, causing all of the events the component was tracking to be lost.
To avoid this problem, you should do several things. First, you should set your buffer to an appropriate size for the approximate number of events you expect to receive. By default, the buffer is set to a size of 4 KB. A 4-KB buffer can track changes on approximately 80 files in a directory. Each event takes up 16 bytes in the buffer, plus enough bytes to store the name of the file that the event occurred on, in Unicode (2 bytes per character). You can use this information to approximate the buffer size you will need
You reset the buffer size by setting the InternalBufferSize property. If you are using Microsoft Windows 2000, you should increase the buffer size in increments of 4 KB. With any other operating system, you should increase the buffer size in increments that correspond to the operating system’s default page size.
Tip If you are unsure of the default page size for the operating system you are using, the safest way to proceed is to just double the original size of the buffer. This will maintain the original interval needed for your operating system.
In addition to setting an appropriate buffer size, you can use the following three properties to control the amount of information that the buffer receives:
Note Although you can also use the Filter property to specify files or subdirectories that you want watched, this property is applied after changes are added to your buffer and will not reduce the buffer size at all. Instead, use the Mode and ChangedEventFilter properties to control the amount of information written to the buffer.
Configuring FileSystemWatcher Component Instances | Introduction to File System Components