-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
{ buffer: false } seems to impose a limit on the number/size of files #910
Comments
Probably JS running out of memory which I think was the whole thing streaming mode was supposed to solve. Hmm. Can you try messing with the highWaterMark in gulp.src (its an option passed to through2) and see if that fixes anything? |
The node executable on Windows has a memory footprint around 70 MB. So I guess memory is not the issue here. But as you suggested I modified through2's What's really strange is that the copy process succeeds if |
FYI, I'm running node 64-bit. |
I traced this down to an EMFILE error happening while opening the source file: $ NODE_DEBUG=GFS gulp test
...
GFS 12840: open done { [Error: EMFILE, open 'C:\somewhere\gulp-static-site\dist\products\2838.jpg']
errno: -4066,
code: 'EMFILE',
path: 'C:\\somewhere\\gulp-static-site\\dist\\products\\2838.jpg' } undefined
GFS 12840: enqueue 1 OpenReq { path: 'C:\\somewhere\\gulp-static-site\\dist\\products\\2838.jpg',
flags: 'w',
mode: 33206,
cb: [Function],
done: [Function],
failures: 1 }
GFS 12840: fds { fd3: 'C:\\somewhere\\gulp-static-site\\dist\\products\\1.jpg',
fd4: 'C:\\somewhere\\gulp-static-site\\dist\\products\\10.jpg',
fd5: 'C:\\somewhere\\gulp-static-site\\dist\\products\\100.jpg',
fd6: 'C:\\somewhere\\gulp-static-site\\dist\\products\\1000.jpg',
fd7: 'C:\\somewhere\\gulp-static-site\\dist\\products\\1001.jpg',
... (lots more)
GFS 12840: [ { path: 'C:\\somewhere\\gulp-static-site\\dist\\products\\2838.jpg',
flags: 'w',
mode: 33206,
cb: [Function],
done: [Function],
failures: 1 } ]
assert.js:86
throw new assert.AssertionError({
^
AssertionError: 1 == 0
at process.<anonymous> (C:\somewhere\gulp-static-site\node_modules\gulp\node_modules\vinyl-fs\node_modules\graceful-fs\graceful-fs.js:28:12)
at process.emit (events.js:129:20) I wonder, why does node not close the destination fd once the file has been copied? |
Possibly related: nodejs/node-v0.x-archive#6041, isaacs/node-graceful-fs#20 |
Moving to gulpjs/vinyl-fs#56 |
I've just started with gulp trying to automate mostly product image processing. As you can imagine we have a large number of product images. For my tests I started with 5000 images, exactly 1 MB each (they were generated by a script during my tests).
Setup
My first objective is to just copy the files from source to destination without further processing. As gulp does not need to read the file contents (yet), I pass
{ buffer: false }
togulp.src
:When I run gulp the process starts and then just stops without further information (no "finished" line):
Results
After that I have exactly 1985 files in my
dist/products
directory. 1984 of these are 1 MB in size, 1 has 0 bytes. The sum of these files is 2 GB, and that limit seems somewhat special. This is reproducible.If I pass
{ buffer: false }
(or omit it), all files get copied, but the memory footprint is much higher.Technical information
I tested both on Windows:
And on Fedora 21, where only 985 files are copied:
The text was updated successfully, but these errors were encountered: