Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions doc/api/buffer.md
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ _may contain sensitive data_. Use [`buf.fill(0)`][`buf.fill()`] to initialize
such `Buffer` instances with zeroes.

When using [`Buffer.allocUnsafe()`][] to allocate new `Buffer` instances,
allocations less than `Buffer.poolSize >>> 1` (4KiB when default poolSize is used) are sliced
allocations less than `Buffer.poolSize >>> 1` (32KiB when default poolSize is used) are sliced
from a single pre-allocated `Buffer`. This allows applications to avoid the
garbage collection overhead of creating many individually allocated `Buffer`
instances. This approach improves both performance and memory usage by
Expand Down Expand Up @@ -1513,9 +1513,13 @@ console.log(Buffer.isEncoding(''));

<!-- YAML
added: v0.11.3
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/63597
description: Default raised from 8192 to 65536.
-->

* Type: {integer} **Default:** `8192`
* Type: {integer} **Default:** `65536`

This is the size (in bytes) of pre-allocated internal `Buffer` instances used
for pooling. This value may be modified.
Expand Down
2 changes: 1 addition & 1 deletion lib/buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ const constants = ObjectDefineProperties({}, {
},
});

Buffer.poolSize = 8 * 1024;
Buffer.poolSize = 64 * 1024;
let poolSize, poolOffset, allocPool, allocBuffer;

function createPool() {
Expand Down
Loading