Hello,
Looks like your XamTabControl is leaking memory. If I replace the XamTabControl with a regular TabControl memoy is released after I force a Garbage Collection. I have the following simpe XAML:
<UserControl x:Class="ControlsLibrary.wpf.TabUserControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:igWindows="http://infragistics.com/Windows" > <Grid> <igWindows:XamTabControl> </igWindows:XamTabControl> <!--<TabControl> </TabControl>--> </Grid></UserControl>
with the following code behind:
public partial class TabUserControl : UserControl { //Mailbox parent; //UserControl activeContent; public byte[ myMemory = new byte[50 * 1024 * 1024]; public TabUserControl() : this(null, null, -1) { InitializeComponent(); } }
Please try this and advise.
Klaus
The snippet you provided doesn't seem like it would compile and it doesn't show how the usercontrol was being used but if you can provide a sample I'll take a look.
public partial class TabUserControl : UserControl { //Mailbox parent; //UserControl activeContent; public byte[ myMemory = new byte[50 * 1024 * 1024]; public TabUserControl() { InitializeComponent(); } }
Create an instance of TabUserControl and add to a Window.
Open and close the Window, then force a GC. Observe that the 50M allocated is not released.
Instead of XamTabControl, use WPF's native TabControl. Perform the same operations and observe that memory is released after you force a GC.