-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Potential Memory Leak With Inactive md-tab #1986
Comments
Is there any workaround to this issue? I have a bunch of directives within tabs that needs the $destroy event to clean up a lot of resources. Will this behavior change? |
LumX behaves as expected, where loaded directives within the tabs all receive the $destroy event. Following this issue and reverting back to Angular Md tab-control whenever there is a workaround available. |
BREAKING CHANGE: Generated HTML structure has changed, so custom styles will need to be updated to match the new HTML structure. Closes #1087 Closes #1107 Closes #1140 Closes #1247 Closes #1261 Closes #1380 Closes #1387 Closes #1403 Closes #1443 Closes #1505 Closes #1506 Closes #1516 Closes #1518 Closes #1564 Closes #1570 Closes #1620 Closes #1626 Closes #1698 Closes #1777 Closes #1788 Closes #1850 Closes #1959 Closes #1986
BREAKING CHANGE: Generated HTML structure has changed, so custom styles will need to be updated to match the new HTML structure. Closes #1087 Closes #1107 Closes #1140 Closes #1247 Closes #1261 Closes #1380 Closes #1387 Closes #1403 Closes #1443 Closes #1505 Closes #1506 Closes #1516 Closes #1518 Closes #1564 Closes #1570 Closes #1620 Closes #1626 Closes #1698 Closes #1777 Closes #1788 Closes #1850 Closes #1959 Closes #1986
BREAKING CHANGE: Generated HTML structure has changed, so custom styles will need to be updated to match the new HTML structure. Closes #1087 Closes #1107 Closes #1140 Closes #1247 Closes #1261 Closes #1380 Closes #1387 Closes #1403 Closes #1443 Closes #1505 Closes #1506 Closes #1516 Closes #1518 Closes #1564 Closes #1570 Closes #1620 Closes #1626 Closes #1698 Closes #1777 Closes #1788 Closes #1850 Closes #1959 Closes #1986
BREAKING CHANGE: Generated HTML structure has changed, so custom styles will need to be updated to match the new HTML structure. Closes #1087 Closes #1107 Closes #1140 Closes #1247 Closes #1261 Closes #1380 Closes #1387 Closes #1403 Closes #1443 Closes #1505 Closes #1506 Closes #1516 Closes #1518 Closes #1564 Closes #1570 Closes #1620 Closes #1626 Closes #1698 Closes #1777 Closes #1788 Closes #1850 Closes #1959 Closes #1986 Closes #2020
BREAKING CHANGE: Generated HTML structure has changed, so custom styles will need to be updated to match the new HTML structure. Closes #1087 Closes #1107 Closes #1140 Closes #1247 Closes #1261 Closes #1380 Closes #1387 Closes #1403 Closes #1443 Closes #1505 Closes #1506 Closes #1516 Closes #1518 Closes #1564 Closes #1570 Closes #1620 Closes #1626 Closes #1698 Closes #1777 Closes #1788 Closes #1850 Closes #1959 Closes #1986 Closes #2020
Was this behavior changed, so it always calls $destroy now? |
I read through all the latest code changes related to the closing of this issue, are suppose to listen to tab deactivate to destroy resources? I mean, using directives within the tabs is something I'm sure many will do and at least for my use, my directive are themselves responsible for cleaning up resources during $destroy. I can't use this control until there is some workaround, it gives my app memory leak that uses hundreds of megabytes. |
@sondreb The tabs code has been recently rewritten in master for 0.9.0 (not released yet). In the process, I tried to address as many existing issues as possible. One of these decisions was to remove our scope disconnect logic, which was likely the cause of your issue. Once 0.9.0 is released, you shouldn't have any issues; however, if the issue does show up, please either comment here to let me know or open a new ticket. |
@robertmesserle So I'm glad to hear the memory leak is most likely fixed in 0.9.0. However, I did like the idea of how non - displayed tabs were removed from scope for performance reasons...is there any plan to re - add this feature? |
Possibly, or it could be accomplished though ng-if. We plan to look into
|
@robertmesserle Ok great! I originally thought removing the tab from the digest cycle was a clever way to improve overall app performance until I stumbled across the Regarding
and
We like how the old My understanding is that So our vote is for something other than |
In relation to #1982, I'm including code in my directives' controllers that prints out when controllers are destroyed.
For example:
Based on my exploration of the code and the documentation, internal non-active tab content is removed from the
$scope\$digest
cycle:https://material.angularjs.org/#/api/material.components.tabs/directive/mdTabs:
Since Material Design detaches inactive Tab content from the $scope/$digest cycle, none of my controllers for all my "inactive" tabs print out
Destorying: file-grid-ctrl
. This leads me to believe that any resources or other things I may be "destroying/tearing down/disposing" of in my$destroy
callback are not being called, leading to potential memory issues.Perhaps instead when tabs are removed or destroyed, they should be "re-connected" to the $scope/$digest cycle right before destruction?
The text was updated successfully, but these errors were encountered: