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 #489
Comments
I'm pretty sure this has nothing to do with stimulus. In this instance, stimulus is the event handling for executing the javascript, it the standard javascript that creating and clearing the nodes. It's been discussed a lot in other javascript forums:
You can read through this post for possible alternatives to innerHTML: |
@tleish I noticed an interesting feature. If I remove the line: div.setAttribute('data-action', 'click->item#log') Nodes are removed as expected. I don't understand how to explain it. It seems to me that the event listener is not deleted or there is a link to it somewhere. Because of this, the nodes are also not deleted. |
@intrip Yes, this fixes the current bug. The garbage collector removes all unused nodes. Good job. |
Great! Let's close the issue now ? |
Removed elements are not deleted from memory.
^^^ Nodes and Listeners are not cleared
We create the "List" controller, in it we create elements for the "Item" controller. When the button is clicked, the item is cleared and a list is created. When you click on the "Reload" button, a memory leak occurs. The garbage collector doesn't help.
Example:
index.html
script.js
The text was updated successfully, but these errors were encountered: