Memory issue when panning or zooming?

Jul 20, 2010 at 6:25 PM

I have noticed that if I pan or zoom my timeline application when several events are on the screen, the memory size of the application immediately grows significantly.  You can run the WpfTimelineExample (provided in the source code download), fire up task manager and watch the processes tab, and you can see the amount of memory increasing quickly as you zoom and pan.  The application initially loads and takes up about 17MB, and after about a minute of frequent panning and zooming, it takes up about 45 MB.  My suspicion is that there is a memory leak somewhere within the TimelineTray.RefreshEvents() method, but I have not been able to pinpoint it.  Does anyone have any suggestions?  Thanks in advance!

Jul 22, 2010 at 6:00 PM

Could be, please open a bug for it.

 

Mar 23, 2011 at 1:52 PM

ajk3e is right though...

The following is making the resize, panning or zooming go insane...

I'm currently running this program in nl-BE as cultureID.. but setting it in the timelineTray doens't help.

System.Windows.Data Error: 23 : Cannot convert '' from type 'String' to type 'System.Windows.Media.ImageSource' for 'en-US' culture with default conversions; consider using Converter property of Binding. NotSupportedException:'System.NotSupportedException: ImageSourceConverter cannot convert from System.String.
   at System.ComponentModel.TypeConverter.GetConvertFromException(Object value)
   at System.ComponentModel.TypeConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
   at System.Windows.Media.ImageSourceConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
   at MS.Internal.Data.DefaultValueConverter.ConvertHelper(Object o, Type destinationType, DependencyObject targetElement, CultureInfo culture, Boolean isForward)'
System.Windows.Data Error: 6 : 'TargetDefaultValueConverter' converter failed to convert value '' (type 'String'); fallback value will be used, if available. BindingExpression:Path=Event.TeaserEventImage; DataItem='TimelineDisplayEvent' (Name=''); target element is 'Image' (Name='EventImage'); target property is 'Source' (type 'ImageSource') NotSupportedException:'System.NotSupportedException: ImageSourceConverter cannot convert from System.String.
   at MS.Internal.Data.DefaultValueConverter.ConvertHelper(Object o, Type destinationType, DependencyObject targetElement, CultureInfo culture, Boolean isForward)
   at MS.Internal.Data.TargetDefaultValueConverter.Convert(Object o, Type type, Object parameter, CultureInfo culture)
   at System.Windows.Data.BindingExpression.ConvertHelper(IValueConverter converter, Object value, Type targetType, Object parameter, CultureInfo culture)'

<Grid
                    x:Name="grdTimeLine">
                    <Grid.RowDefinitions>
                        <RowDefinition
                            Height="*" />
                        <RowDefinition
                            Height="30" />
                    </Grid.RowDefinitions>

                    <timeline:TimelineTray
                        x:Name="timeline"
                        Grid.Row="0"
                        MinDateTime="1/1/1839"
                        MaxDateTime="1/1/1930"
                        CalendarType="gregorian"
                        HorizontalAlignment="Stretch"
                        CurrentDateTime="11/01/1855" TimelineReady="timeline_TimelineReady">

                        <Grid.RowDefinitions>
                            <RowDefinition
                                Height="*" />
                            <RowDefinition
                                Height="50" />
                            <RowDefinition
                                Height="30" />
                        </Grid.RowDefinitions>

                        <timeline:TimelineBand
                            IsMainBand="True"
                            ItemSourceType="years"
                            TimelineWindowSize="20"
                            MaxEventHeight="130"
                            Margin="0,72,0,0" />

                        <timeline:TimelineBand
                            Grid.Row="1"
                            HorizontalAlignment="Stretch"
                            ItemSourceType="decades"
                            TimelineWindowSize="16"
                            MaxEventHeight="4" />

                        <timeline:TimelineToolbox
                            Grid.Row="1"
                            Margin="0,40,0,0"
                            Grid.RowSpan="2"></timeline:TimelineToolbox>
                        <TextBox
                            Height="23"
                            HorizontalAlignment="Left"
                            Margin="82,12,0,0"
                            Name="minDateTime"
                            VerticalAlignment="Top"
                            Text="{Binding Path=MinDateTime, ElementName=timeline}"
                            Width="122"></TextBox>
                        <Label
                            Height="28"
                            HorizontalAlignment="Left"
                            Margin="6,12,0,0"
                            Name="label1"
                            VerticalAlignment="Top"
                            Width="120">MinDateTime</Label>
                        <TextBox
                            Height="23"
                            Margin="285,12,352,0"
                            Name="maxDateTime"
                            Text="{Binding Path=MaxDateTime, ElementName=timeline}"
                            VerticalAlignment="Top"></TextBox>
                        <Label
                            Height="28"
                            HorizontalAlignment="Left"
                            Margin="210,10,0,0"
                            Name="label2"
                            VerticalAlignment="Top"
                            Width="120">MaxDateTime</Label>
                        <TextBox
                            Height="23"
                            HorizontalAlignment="Right"
                            Margin="0,12,130,0"
                            Name="currentDateTime"
                            VerticalAlignment="Top"
                            Text="{Binding Path=CurrentDateTime, ElementName=timeline}"
                            Width="129"></TextBox>
                        <Label
                            Height="28"
                            HorizontalAlignment="Right"
                            Margin="0,10,234,0"
                            Name="label3"
                            VerticalAlignment="Top"
                            Width="120">CurrentDateTime</Label>
                        <Slider
                            Height="26"
                            Margin="12,40,6,0"
                            Name="slider1"
                            VerticalAlignment="Top"
                            Maximum="36500"
                            ValueChanged="slider1_ValueChanged" />
                        <Label Content="Selected" Height="28" HorizontalAlignment="Right" Margin="0,10,60,0" Name="label4" VerticalAlignment="Top" />
                        <Label Content="{Binding ElementName=timeline, Path=SelectedTimelineEvents.Count,NotifyOnSourceUpdated=True}" Height="25" HorizontalAlignment="Right" Margin="0,10,40,0" Name="selectedCount" VerticalAlignment="Top" Target="{Binding ElementName=timeline, Path=SelectedTimelineEvents}" />
                    </timeline:TimelineTray>
                    <Button
                        Content="Change Image"
                        Grid.Row="1"
                        Height="30"
                        HorizontalAlignment="Left"
                        Margin="594,1,0,0"
                        Name="button2"
                        VerticalAlignment="Top"
                        Width="82"
                        Click="Button2Click" DataContext="{Binding ElementName=timeline, Path=SelectedTimelineEvents}" />

                    <Button
                        Content="ResetEvents"
                        Grid.Row="1"
                        Height="30"
                        HorizontalAlignment="Left"
                        Margin="684,1,0,0"
                        Name="button1"
                        VerticalAlignment="Top"
                        Width="82"
                        Click="button1_Click" DataContext="{Binding ElementName=timeline, Path=SelectedTimelineEvents}" />
                </Grid>
Mar 23, 2011 at 4:20 PM

I only get the first error ( 23 ) if i use the downloadable WPFLibrary.dll file...

But still Resizing, zooming is horribly slow.. and produces a ton of error 23's in .NET 4.0

Mar 24, 2011 at 4:59 AM

Checked in the fix. Could you verify that this error 23 is fixed.

Mar 24, 2011 at 7:57 AM

Works like a charm now.

Thank you very much. :)