-
Notifications
You must be signed in to change notification settings - Fork 845
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
Help Wanted, Possible Memory leak? #392
Comments
Greetings ! |
Hello @m-majetic, unfortunately I have not managed to resolve the issue but it's nice to see someone else has encountered the issue. In a round about sort of way. |
I see that other issues haven't been closed as well. |
Hmm makes you wonder doesn't it. |
I've taken a bit of time to look into this. From what I can tell from your screenshots, and a brief session with the Node debugger myself, it looks like those strings are the source strings for the constructed function that the Template objects use to execute and render templates here: https://github.com/mde/ejs/blob/master/lib/ejs.js#L626 This is a result of using the I took Express out of the equation completely, just loading EJS into a Node script and calling I'm not sure if these strings are slow to GC, or what, but I have not been able to isolate anything specific in EJS that looks anything like a memory leak. I do see memory go up, but the behavior looks almost identical with the inline use of a Function constructor, or even with a complete no-op in that same loop. Having said that, I will continue to dig into this and see if I can track down something more concrete. I only took a cursory look at this today, so I may very well be missing something else. Thanks for your patience with this. |
Not an issue with EJS. For reference: expressjs/express#3751 (comment) |
Hello, okay so i know there have been other issues on the same subject but im at a loss with this and need some help please. Okay so why do i think EJS is the cause? here is some screen shots of heap snapshots in comparison between start up and after autocannon.
![image](https://user-images.githubusercontent.com/15389482/43230364-d64b2408-905f-11e8-82f4-ab631ec3622d.png)
![image](https://user-images.githubusercontent.com/15389482/43230227-609f8f28-905f-11e8-9dc3-9cd324e202d2.png)
As you can see in the above image there is a sizable difference in file size given its a web server.
so after taking this and searching through the code I boiled it down to line 573 in ejs.js which is located in the lib folder of the ejs library.
![image](https://user-images.githubusercontent.com/15389482/43230296-a3041866-905f-11e8-84c4-6011a1ac7e44.png)
Further scrolling through the leaked strings I found this which i think confirms the leak to be related to EJS:
I will add more as I get it, Again any help is very much appreciated and can someone please add the help-wanted tag.
Many Thanks.
EDIT: Code!! Because everyone loves code.
The text was updated successfully, but these errors were encountered: