Buffers

Every topic in this chapter, free to read online. Work through them in order, or jump straight to the runtime detail you need.

Start with the first topic2.1 What Is a Buffer?
02chapter
4topics
Freeonline

Topics

4 topics

What Is a Buffer?

What a Buffer is in Node.js: a fixed-size mutable byte sequence for files, sockets, hashes, images, compressed payloads, and undecoded I/O.

Buffer Allocation

How Buffer.alloc, Buffer.allocUnsafe, Buffer.from, slab pooling, and large Buffer allocation affect memory safety and performance in Node.js.

Buffer Operations

How Buffer views, copies, TypedArray interop, worker transfer, and zero-copy parsing affect byte ownership in Node.js.

Buffer Fragmentation, Retained Views, and External Memory

How Buffer allocation can fragment external memory, pin large backing stores, interact with V8 accounting, and create performance problems in Node.js.