-
Notifications
You must be signed in to change notification settings - Fork 565
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
High memory usage (11x). #46
Comments
Almost all of this comes from the way you are building the result string, context_data_string += … lines. Replacing |
Ok, here are the test results with iojs: 50000 iterations, String concat (current): 31 seconds, 905 MiB. 100000 iterations, String concat (current): 1212 seconds, 1760 MiB, the gc kicked in, 200000 iterations, String concat (current): I terminated it after 100 minutes, 2450 MiB, the gc kicked in, There is enough free memory and swap is disabled, so it didn't affect the results. |
This code:
Takes about 900M in v8 and about 700M (inaccurate) in Firefox.
That memory is released later by the gc, but the peak memory usage is very high, and if you increase the number of rounds even more, gc will kick in at the middle and will slow things down.
The
x
string in the code above isn't special, that happens generally.You could test the memory usage with
console.log(process.memoryUsage());
at the end of the loop in iojs/node.The text was updated successfully, but these errors were encountered: