joyent/node — Issue #1906: Buffer.copy leaks memory
Author: artman
Created: 2011-10-18 04:15:04+00:00
State: open

Buffer.copy in v.0.5.9 leaks memory.

```javascript
var buffer = new Buffer(1024 * 1024 * 50);
var buffer2 = new Buffer(1024 * 1024 * 50);
buffer.copy(buffer2, 0, 0, buffer.length);
buffer = buffer2 = null;
```
The above code will have Node take up ~120 Megabytes of memory that is never released.

Without Buffer.copy, the buffers are released correctly.