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

Calling FS + writeFile causes massive memory usage due to log #812

Closed
Balearica opened this issue Aug 27, 2023 · 0 comments · Fixed by #814
Closed

Calling FS + writeFile causes massive memory usage due to log #812

Balearica opened this issue Aug 27, 2023 · 0 comments · Fixed by #814

Comments

@Balearica
Copy link
Member

The worker.FS function logs all arguments it receives. While this would be fine for a function that only has boolean/integer/etc. arguments, this function is used to write massive files. This log function is therefore massively inflating memory usage.

https://github.com/naptha/tesseract.js/blob/master/src/worker-script/index.js#L60-L63

One test I ran showed that writing eng.traineddata to the virtual filesystem using FS peaked Node memory usage at 700MB, which is ridiculous for writing a ~20MB file. The log call should be modified to remove args.

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

Successfully merging a pull request may close this issue.

1 participant