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

bug: Memory leak #209

Open
3 tasks done
raymondboswel opened this issue Jan 24, 2023 · 4 comments
Open
3 tasks done

bug: Memory leak #209

raymondboswel opened this issue Jan 24, 2023 · 4 comments
Labels
Resolution: Needs Investigation This PR or Issue should be investigated from the Stencil team

Comments

@raymondboswel
Copy link

Prerequisites

Stencil Store Version

2.0.3

Stencil Version

2.22.2

Current Behavior

Nodes aren't garbage collected when using stencil/store.

Expected Behavior

Nodes should get garbage collected.

Steps to Reproduce

Clone https://github.com/raymondboswel/stencil-redux-example
In terminal a: cd mock-server; node server.ts
In terminal b: npm run start

Open performance monitor, and memory tab. Trigger garbage collector. Take note of nodes count.

Spam click 'Toggle RxJS Todos' button. Trigger garbage collector. Take note of nodes count.

Spam click 'Toggle Stencil/store Todos' button. Trigger garbage collector & notice that nodes count does not decrease.

Code Reproduction URL

https://github.com/raymondboswel/stencil-redux-example

Additional Information

No response

@ionitron-bot ionitron-bot bot added the triage label Jan 24, 2023
@rafael-leal-mccormack
Copy link

Also something ive noticed is that when you add an onChange inside of a component, that reference is being saved and causing detatched elements to stay on the pages. This would be something good to look into.

@rwaskiewicz
Copy link
Member

Hey @raymondboswel 👋

Thanks for the reproduction case! Would it be possible to try to reduce the scope of this reproduction case such that it only uses @stencil/core and @stencil/store? At the moment, the repro is a little too big for someone to try to wade through in order to perform root cause analysis. Thanks!

@rwaskiewicz rwaskiewicz added the Awaiting Reply This PR or Issue needs a reply from the original responder. label Feb 9, 2023
@ionitron-bot ionitron-bot bot removed the triage label Feb 9, 2023
@raymondboswel
Copy link
Author

@rwaskiewicz I created a new repo from the same codebase.
RTKQuery was removed from the flow of the memory leak reproduction. I left the peripheral
code for reference as an example of essentially the same code without a leak. You only need to look at
app-stencil-store-todos.tsx and follow the data flow as initiated in the component (service -> store -> component).

I've also narrowed the source of the leak down somewhat, though I still don't know why it would leak. See
app-stencil-store-todos.tsx:16

https://github.com/raymondboswel/stencil-store-memory-leak

@ionitron-bot ionitron-bot bot removed the Awaiting Reply This PR or Issue needs a reply from the original responder. label Feb 14, 2023
@ionitron-bot ionitron-bot bot added the ionitron: stale issue This issue has not seen any activity for a long period of time label Mar 16, 2023
@ionitron-bot
Copy link

ionitron-bot bot commented Mar 16, 2023

Thanks for the issue! This issue is being closed due to inactivity. If this is still an issue with the latest version of Stencil, please create a new issue and ensure the template is fully filled out.

Thank you for using Stencil Store!

@ionitron-bot ionitron-bot bot closed this as completed Mar 16, 2023
@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Mar 16, 2023
@rwaskiewicz rwaskiewicz reopened this Mar 16, 2023
@rwaskiewicz rwaskiewicz added Resolution: Needs Investigation This PR or Issue should be investigated from the Stencil team and removed ionitron: stale issue This issue has not seen any activity for a long period of time labels Mar 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Needs Investigation This PR or Issue should be investigated from the Stencil team
Projects
None yet
Development

No branches or pull requests

3 participants