-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closing TabViewItems Does Not Free Used Memory #2938
Comments
I presume this is because TabView is based off of ListViewBase (and a StackPanel as the ItemsPanel) which does not seem to dispose of its items when cleared. |
I've figured out what causes this behavior to occur. The lack of garbage collection seems to happen when I add TabViewItems to the TabView rather than just setting the ItemSource to an ObservableCollection. (Which makes sense...) I'm going to close this issue now. |
The same problem with memory Leaks is when in the xaml to add the TabViewItems with inside Usercontrol for example:
In this case when the page that contain the tabView is Disposed the Tabview maintain the usercontrol live. public class TabViewExt : TabView
If i call Items.Clear(); all working well and the usercontrol is disposed. |
I'm submitting a...
Bug report (I searched for similar issues and did not find one)
Current behavior
When a user creates a new TabViewItem with a Frame as content, RAM usage will increase for each created item. However, closing one or more of these tabs will keep RAM usage exactly the same with no decrease.
Expected behavior
For many application scenarios, the user expects this memory usage to decrease when the tabs are closed.
Minimal reproduction of the problem with instructions
https://1drv.ms/f/s!AvgU7aa_XojB4kTts9UV5xXGWNfD
Try to create new tabs and monitor memory usage as they are closed.
Environment
The text was updated successfully, but these errors were encountered: