Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.2k
Closed
Labels
fsIssues and PRs related to the fs subsystem / file system.Issues and PRs related to the fs subsystem / file system.streamIssues and PRs related to the stream subsystem.Issues and PRs related to the stream subsystem.
Description
If I execute the following code snippet in node >= 4.2.0, it results in the read stream reading the data very fast but not being able to write them out to wr2 equally fast. The memory usage of the process increases very fast until the process exits with an error.
varfs=require('fs');//M: and L: are local disks with fast read and write// the .mov file is several gigabytes in sizevarrd=fs.createReadStream('M:/A007C003_141024_R7C6.mov');varwr=fs.createWriteStream('L:/A007C003_141024_R7C6.mov');//N: is a NAS drive, slowvarwr2=fs.createWriteStream('N:/A007C003_141024_R7C6.mov');//read from fast disk, write to both fast and slow diskrd.pipe(wr);rd.pipe(wr2);The script ends with this error:
.\node-4.2.0 test.js buffer.js:98 const ui8 = new Uint8Array(size); ^ RangeError: Invalid array buffer length at new ArrayBuffer (native) at new Uint8Array (native) at allocate (buffer.js:98:17) at new Buffer (buffer.js:49:12) at Function.Buffer.concat (buffer.js:234:16) at fromList (_stream_readable.js:840:20) at ReadStream.Readable.read (_stream_readable.js:339:11) at flow (_stream_readable.js:743:26) at WriteStream.<anonymous> (_stream_readable.js:601:7) at emitNone (events.js:67:13) at WriteStream.emit (events.js:166:7) Earlier versions of node (4.1.2 and below) do not show the same behaviour.
- Version: v4.2.0
- Platform: Win10 64bit
- Subsystem:
Metadata
Metadata
Assignees
Labels
fsIssues and PRs related to the fs subsystem / file system.Issues and PRs related to the fs subsystem / file system.streamIssues and PRs related to the stream subsystem.Issues and PRs related to the stream subsystem.