Issue Description
We are facing a memory leak issue When destroying the HTM Table after performing a mouse click action in its cell. This behavior could indicate improper element removal or unnecessary node creation, potentially impacting performance and causing unintended functionality.
https://github.com/hemanthkumar-syncfusion/html-table
https://github.com/hemanthkumar-syncfusion/html-table/issues/1
DOM Nodes Count:
Initial
After rendering the table and clicking on any cell
After destroying the table
I checked the issue in both Edge and Chrome, and was able to observe the element in a detached state. I was also able to reproduce the same memory issue in both the HTML input and button. I checked the event listeners for those elements but was unable to find the cause.
Replication Procedure:
- Run the sample.
- Check the initial DOM node in the performance monitor tab after garbage collector in the memory tab.
- Click the Create Table Button.
- Click any one of cells.
- Click the Destroy Button to destroy the table.
- Now check the DOM Node count in the performance monitor tab.
Question:
- How to resolve this memory leak issue?
- I also observed that each time a cell is clicked, the number of JavaScript event listeners seems to increase. Could you kindly explain why this is happening?
3