The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

FileSystemWatcher.InternalBufferSize Property

Gets or sets the size of the internal buffer.

Namespace: System.IO
Assembly: System (in system.dll)

public int InternalBufferSize { get; set; }
/** @property */
public int get_InternalBufferSize ()

/** @property */
public void set_InternalBufferSize (int value)

public function get InternalBufferSize () : int

public function set InternalBufferSize (value : int)

Not applicable.

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, and it stores those changes in a buffer the component creates and passes to the APIs. Each event can use up to 16 bytes of memory, not including the file name. 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 has the following ramifications:

  • Increasing the buffer size can prevent missing file system change events. Note that an instance of the FileSystemWatcher class does not raise an Error event when an event is missed or when the buffer size is exceeded, due to dependencies with the Windows operating system.

  • Increasing buffer size 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.

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions