Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardNodeJSBuffer pool and allocationSingle-choice MCQ

What does this code reveal about how Node's small-Buffer pool can cause one buffer to retain memory far larger than its own length?

const keep = []; for (let i = 0; i < 3; i++) { const b = Buffer.allocUnsafe(10); keep.push(b); } // keep[0] alone may retain the whole pool slab