-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
huge memory leak #909
Comments
Are you talking about the python implementation or the javascript one? Could you provide an example of how you measured this? |
I'm talking about js version. I tested more with different scripts, looks like some perhaps trigger some weird results. For example, paste into node:
This will take hundreds of megs of ram in no time. With other scripts I saw less dramatic results where ram seems to stay stable (e.g. with jquery: https://code.jquery.com/jquery-1.12.2.min.js) |
I can reproduce the issue with the file you sent. Thanks! |
Any pointers on how I could track it down myself? |
You can try turning off the formatting handlers (so only parsing runs) - comment out the line that calls the handlers formatting. Then turn the handlers back on one by one. Chrome has a memory profiler that might help as well. |
This seems to fix the issue: https://github.com/beautify-web/js-beautify/tree/feature/memory-leak . Minor performance degradation, but acceptable. I'll look at including it in the next release. |
It looks like js-beautify is a giant memory hog. It wasn't meant to be used in code by long-running aps?
If I take any minified js file from google and run js-beautify in a loop I get 50-100M plus on each iteration.
The text was updated successfully, but these errors were encountered: