canvas-datagrid icon indicating copy to clipboard operation
canvas-datagrid copied to clipboard

refresh data cause memory leak

Open javahuang opened this issue 4 years ago • 4 comments

Expected behavior and actual behavior.

refresh same data cause memory become larger and larger

Jietu20210201-002941@2x

Jietu20210201-002923@2x

Steps to reproduce the problem.

Specifications like the version of the project, operating system, or hardware.

version: 0.25.4 operating system: chrome 88 macos

javahuang avatar Jan 31 '21 16:01 javahuang

self.dispose = function () {
...
if (self.observer && self.observer.disconnect) {
      self.observer.disconnect();
    }
}

after grid dispose, self.observer always return undefine, so MutationObserver can't disconnect

javahuang avatar Feb 01 '21 03:02 javahuang

Thank you for the report, @javahuang ! As our time is limited, if you see any opportunity to provide a fix , we'd greatly appreciate it!

ndrsn avatar Feb 01 '21 13:02 ndrsn

hi,I want to know how to fix this bug,could you give me some method of fixing this. I also found memory leak, which I wonder if the bug have cause this situation. i found many listeners,and calling dispose() didn't reduce the number of listeners

thank you

l0g1n avatar Dec 17 '21 14:12 l0g1n

Memory leaks are caused by lingering references to data. This can be in the form of event listeners or functions that touched the data to alter order etc..

Using the heap inspector in chrome's performance dev tools can help shine a light on these refs. That's where I would start.

TonyGermaneri avatar Dec 17 '21 19:12 TonyGermaneri