angular-strap icon indicating copy to clipboard operation
angular-strap copied to clipboard

Memory leak when removing tabs

Open joaoborsoi opened this issue 10 years ago • 4 comments

Hello, I'm building an ERP with angular-strap, and trying to use tabs to dynamic open complex documents, with forms and complex controls. I'm running into some memory leak issues, when I dynamically remove a tab. I wonder if someone could help me. I'm not sure if it's an angular-strap issue. I made a very simple plunker example, with a button to add a tab with big data, and then a button to close this tab.

Using the chrome developer tool on an embedded view, I took a heap snapshot before adding the big tab (67MB), then after adding the big tab (135MB) and then after removing the big tab (117MB). If you keep adding and removing the tab, the heap snapshots will grow until no end.

Does someone knows how to free the tab memory after closing it?

joaoborsoi avatar Feb 16 '16 16:02 joaoborsoi

I found it my self! The bug is on the bsPane directive. It registers an render function at bsTabCtrl $activePaneChangeListeners, but it isn't removed by the $destroy event, and then doesn't free the memory. I made a fork on the plunker with the correction on tab.js.

joaoborsoi avatar Feb 20 '16 21:02 joaoborsoi

Please send a PR.

mgcrea avatar Feb 22 '16 15:02 mgcrea

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 26 '19 02:01 stale[bot]

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar May 06 '19 14:05 lock[bot]