Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var MaxBufferSize = 10000
MaxBufferSize is the maximum size that a buffer will be allowed to grow before it is automatically removed from the buffer pool. This prevents large memory allocations from permanently sitting in the buffer pool. You should set MaxBufferSize to a value that is bigger than most http request sizes. The default is 10,000 bytes.
Functions ¶
Types ¶
type BufferPoolI ¶
BufferPoolI describes a buffer pool that can be used to improve memory allocation and garbage collection for frequently used memory buffers.
var BufferPool BufferPoolI
BufferPool is the global buffer pool used by the page drawing system. You can use it to get buffers for you own writes as well. The default buffer pool uses MaxBufferSize to limit the size of buffers that are put back into the pool. If a particular http request required a large buffer to satisfy, this prevents that buffer from hanging around too long. You should set MaxBufferSize to a value that is bigger than most http request sizes.