Forcing garbage collection in Google Chrome

后端 未结 3 1738
旧巷少年郎
旧巷少年郎 2020-11-28 09:39

We are developing a single-page web app with ZK which constantly communicates with server and updates parts of its screens. Updating can be as frequent as 1s. During these u

3条回答
  •  时光说笑
    2020-11-28 10:28

    I found a solution. Apparently Chrome leaks DOM nodes, at least in the current version (26.0.1410.65 right now)

    I recorded dev tools timeline in my app and it showed the Event Listeners count going up and down rhythmically along with my app screen's contents, but the DOM Node count was steadily increasing over time, until the tab crashed.

    I tried the latest Chrome Canary (28.0.1500.3) and they seem to have fixed the problem. DOM Node count graph now follows the same rhythmic pattern as the Event Listeners.

    The thing that gets me is...why doesn't gmail ever crash? I usually keep a tab open for weeks at a time...

提交回复
热议问题