This documentation is archived and is not being maintained.

FileSystemWatcher.InternalBufferSize Property

Gets or sets the size of the internal buffer.

[Visual Basic]
Public Property InternalBufferSize As Integer
public int InternalBufferSize {get; set;}
public: __property int get_InternalBufferSize();
public: __property void set_InternalBufferSize(int);
public function get InternalBufferSize() : int;
public function set InternalBufferSize(int);

Property Value

The internal buffer size. The default is 8192 (8K).


The buffer can be set to anything above 4096 (4K), but for best performance, it should be a multiple of 4K on Intel-based computers.

The system notifies the component of file changes, it stores those changes in a buffer the component creates and passes to the Win32 Application Programming Interfaces (APIs). If there are many changes in a short time, the buffer can overflow. This causes the component to lose track of changes in the directory, and it will only provide blanket notification. Increasing the size of the buffer is expensive, as it comes from non paged memory that cannot be swapped out to disk, so keep the buffer as small as possible. To avoid a buffer overflow, use the NotifyFilter, and IncludeSubdirectories properties to filter out unwanted change notifications.

If the internal buffer overflows, the component raises the Error event.


Platforms: Windows NT Server 4.0, Windows NT Workstation 4.0, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

FileSystemWatcher Class | FileSystemWatcher Members | System.IO Namespace | NotifyFilter | OnError | Filter | IncludeSubdirectories | InternalBufferOverflowException