-
Notifications
You must be signed in to change notification settings - Fork 11
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
memory-leak with basic-app for done-ssr@2 #560
Comments
So maybe a leak in can-globals. I'll check this out now.. |
I'm looking into this again. Have been on something else the last week and a half. |
Here's one cause: canjs/can-dom-data-state#21 This has ripple effects that causes an event listener to be registered with can-globals several times. This might be the source of the CanSimpleDocument leak, but I haven't confirmed that yet. |
Any cause of the leak is that can-view-live listens for when DocumentFragments are removed from the DOM, which of course never happens (their children can be removed). I'm looking into the best way to fix that. |
An update: I was able to find most of the sources of the leak. The biggest problem is in done-ssr where our cleanup code runs outside of the Zone, which causes can-dom-mutate to get the wrong I'm still seeing a small leak but I think I know what's causing it, will update here once everything is confirmed. |
Pull request: #566 |
Reopening as I don't think that PR fixes all leaks. I'm still seeing some leakage from tests, although greatly reduced. I'm going to release a patch version of done-ssr with those leaks fixed and will continue searching. |
This prevents a leak caused by storing a promise with can-dom-data-state. Since this instance of can-dom-data-state comes from Node's module system and not Steal's, this doesn't get cleaned up when we clean up memory with can-dom-mutate. In this case we can replace the usage with Symbols. This commit also turns back on the memory leak test, which is now passing. Closes #560
Found the other leak. #569 fixes it. Re-enabled the memory leak test and there are no more leaks. Will release a patch once that passes. |
2.1.5 is out and all leaks are fixed: https://github.com/donejs/done-ssr/releases/tag/v2.1.5 |
i am getting a memory-leak for [email protected] (possible since
v1.2.0-beta.0
) for a basic-app...src/index.stache
...hitting with
ab -c 5 -n 999 http://localhost:8080/
, i seeCanSimpleDocument
not being cleared in DevTools memory-profiler via three-snapshot-method ( https://www.alexkras.com/simple-guide-to-finding-a-javascript-memory-leak-in-node-js/ ).there might be an additional memory-leak when using a dynamic-import.
src/index.stache
...hitting with
ab -c 5 -n 99 http://localhost:8080/
, i seePromise
(andCanSimpleDocument
) not being cleared.for done-ssr@1, the cause of the dynamic-import memory-leak (mentioned in canjs/can-zone#178 ) was resolved by reverting from...
to...
in
node_modules/can-view-import/can-view-import.js
for[email protected]+
(but does not resolve the memory-leak for done-ssr@2).The text was updated successfully, but these errors were encountered: