Skip to content
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

Copying large directories uses lots of memory #50

Open
jrburke opened this issue Dec 2, 2011 · 0 comments
Open

Copying large directories uses lots of memory #50

jrburke opened this issue Dec 2, 2011 · 0 comments

Comments

@jrburke
Copy link
Member

jrburke commented Dec 2, 2011

@timmywil found that doing a build with an appDir: that had about 450mb of files in it ended up using 600mb before doing the actual dependency tracing.

So there seems to a be a weakness in the copyDir code for node, which does sync file copying via binary writes. This was done because of the ease of dealing with sync file code, but probably need to switch to:

  • Use streams instead of sync file IO via writeFileSync
  • Or, maybe doing a process.nextTick() to break up the work, allow garbage collector to run?

That second one is a bit hacky, and since it would imply needing a callback into file.copyDir, might as well try the stream approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant