WebHttpBinding.MaxBufferPoolSize 属性
定义
获取或设置可为缓冲区管理器分配的最大内存量(以字节为单位),该管理器管理使用此绑定的终结点所需的缓冲区。Gets or sets the maximum amount of memory allocated, in bytes, for the buffer manager that manages the buffers required by endpoints that use this binding.
public:
property long MaxBufferPoolSize { long get(); void set(long value); };
public long MaxBufferPoolSize { get; set; }
member this.MaxBufferPoolSize : int64 with get, set
Public Property MaxBufferPoolSize As Long
属性值
配置了此绑定的终结点所使用的缓冲池的最大大小(以字节为单位)。The maximum size, in bytes, for the pool of buffers used by an endpoint configured with this binding. 默认值为 65,536 字节。The default value is 65,536 bytes.
注解
BufferManager 尝试利用缓冲池将使用缓冲区的成本降至最低。The BufferManager tries to minimize the cost of using buffers with a buffer pool. 当消息离开通道时,服务需要使用缓冲区来处理这些消息。Buffers are required to process messages by the service when they come out of the channel. 如果缓冲池中的内存不足,无法处理消息负载,则 BufferManager 必须从 CLR 堆分配更多内存,而这会增加垃圾回收的系统开销。If there is not sufficient memory in the buffer pool to process the message load, the BufferManager must allocate additional memory from the CLR heap, which increases the garbage collection overhead. 从 CLR 垃圾堆进行大量分配表明缓冲池太小,可以通过提高 MaxBufferPoolSize 限制来实现更大的内存分配,从而提高性能。Extensive allocation from the CLR garbage heap is an indication that the buffer pool size is too small and that performance can be improved with a larger allocation by increasing the MaxBufferPoolSize limit.