Very worried about memory/cpu usage when browsing your Chart examples

6 posts, 0 answers
  1. Danny Scheelings
    Danny Scheelings avatar
    69 posts
    Member since:
    Jan 2006

    Posted 10 Sep 2010 Link to this post

    Hello,

    I am developing a Dashboard for my customer where several charts are being shown to the user. Some users have already complained about the performance, when they are using the application for some time.
    First I thought the problem was in my application (because I am still a learning Silverlight developer), but I have tested your online chart demos (at http://demos.telerik.com/silverlight) and I am very worried about the results.

    - I have tested the demos in IE6, 7 and 8 and in FF on several (Windows) computers.
    - I clicked on all Chart demos below Overview and was just playing around with the features
    - I started Task Manager to monitor the memory and CPU usage of the IE/FF process
    * The memory usage was about 150MB after starting up the Telerik Silverlight application
    * After viewing all demo charts the memory usage was about 300MB. You should expect that the memory usage whould decrease when doing nothing (for about 10 minutes) in the Silverlight application, but it remained at 300MB
    * The CPU usage drops after clicking a demo Chart back to 0%, which is good. But after I viewed 2/3 of your chart demos, the CPU usage did not drop to 0%, but 5%. After viewing the next chart the CPU usage drops back to 7%, and so on. After I viewed all demo Charts the CPU usages was constantly at 25% (4 cores). I also tested it with 1 core and the CPU usages was constantly peaking at 97%.

    I hope that Telerik is able to solve these problems very soon, because in about 1 1/2 month our application is going into production and that is not possible with these memory/cpu results.
    Telerik: please reply !!!

    Thanks,
    Danny
  2. Vladimir Milev
    Admin
    Vladimir Milev avatar
    1061 posts

    Posted 15 Sep 2010 Link to this post

    Hello Danny Scheelings,

    Our products are currently suffering from native memory leaks from the silverlight runtime. We have planned a ServicePack 2 release to address these issues very soon. The update will be released next week.

    Kind regards,
    Vladimir Milev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Danny Scheelings
    Danny Scheelings avatar
    69 posts
    Member since:
    Jan 2006

    Posted 21 Sep 2010 Link to this post

    Hi Vladimir,

    Can you let me know if your are able to reproduce the behavior I have described and if you will be able to sollve this issue? The chart control is of major importance for my project to succeed!

    Thanks,
    Danny
  4. Vladimir Milev
    Admin
    Vladimir Milev avatar
    1061 posts

    Posted 23 Sep 2010 Link to this post

    Hi Danny Scheelings,

    Yes, we are aware of the problems. The sole purpose of the SP2 release is addressing these issues. Things will be much better after we ship SP2. Our internal testing of the latest development version shows almost no memory leaks.

    Kind regards,
    Vladimir Milev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Alexey Oyun
    Alexey Oyun avatar
    74 posts
    Member since:
    Mar 2010

    Posted 25 Oct 2010 Link to this post

    Hi,

    I have made small test based on demo "Live Data" with bubble chart.
    And it seems to have memory leak problem.
    Screen-shot of performance in Process Explorer also attached below.

    Here is code behind:

    public partial class ChartAnimation
    {
        private const int _dataCapacity = 20;
        private const int _limit = 100;
        private readonly Random random = new Random();
        private readonly ObservableCollection<ItemInfo> _data = new ObservableCollection<ItemInfo>();
        private int _interval = 1;
        private int _frame;
        private readonly List<int> _frames= new List<int>();
     
        public ChartAnimation()
        {
            InitializeComponent();
        }
     
        // Executes when the user navigates to this page.
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            SetUpRadChart();
            SetUpYAxis();
            SetUpXAxis();
            SetUpMapping();
            SetUpAxisXRange();
            SetUpInitialData();
     
            SetUpTimer();
        }
     
        private void SetUpInitialData()
        {
            for (int i = 0; i < _dataCapacity; i++)
            {
                ItemInfo systemInfo = new ItemInfo();
     
                systemInfo.Y = random.Next(0, _limit);
                systemInfo.Size = 10;// random.Next(0, _limit);
                systemInfo.X = random.Next(0, _limit);
     
                _data.Add(systemInfo);
            }
            //RadChart1.ItemsSource = _data;
            System.Diagnostics.Debug.WriteLine("Draw : " + _dataCapacity + " bubbles");
        }
     
        private void UpdateData()
        {
            for (int i = 0; i < _dataCapacity; i++)
            {
                ItemInfo info = _data[i];
                if(info.IsYIncreaments)
                {
                    info.Y = info.Y + 1;
                    info.IsYIncreaments = info.Y < _limit;
                }
                else
                {
                    info.Y = info.Y - 1;
                    info.IsYIncreaments = info.Y < 0;
                }
                if(info.IsXIncreaments)
                {
                    info.X = info.X + 1;
                    info.IsXIncreaments = info.X < _limit;
                }
                else
                {
                    info.X = info.X - 1;
                    info.IsXIncreaments = info.X < 0;
                }
                //if (info.IsSizeIncreaments)
                //{
                //  info.Size = info.Size + 1;
                //  info.IsSizeIncreaments = info.Size < _limit;
                //}
                //else
                //{
                //  info.Size = info.Size - 1;
                //  info.IsSizeIncreaments = info.Size < 10;
                //}
            }
        }
     
        public class ItemInfo : INotifyPropertyChanged
        {
            private bool _xDirection;
            public bool XDirection
            {
                get { return _xDirection; }
                set
                {
                    _xDirection = value;
                    NotifyPropertyChanged("XDirection");
                }
            }
     
            private double _x;
            public double X
            {
                get { return _x; }
                set
                {
                    _x = value;
                    NotifyPropertyChanged("X");
                }
            }
     
            private double _y;
            public double Y
            {
                get { return _y; }
                set
                {
                    _y = value;
                    NotifyPropertyChanged("Y");
                }
            }
     
            private double _size;
            public double Size
            {
                get { return _size; }
                set
                {
                    _size = value;
                    NotifyPropertyChanged("Size");
                }
            }
     
            private bool _isXIncreaments;
            public bool IsXIncreaments
            {
                get { return _isXIncreaments; }
                set
                {
                    _isXIncreaments = value;
                    NotifyPropertyChanged("IsXIncreaments");
                }
            }
     
            private bool _isYIncreaments;
            public bool IsYIncreaments
            {
                get { return _isYIncreaments; }
                set
                {
                    _isYIncreaments = value;
                    NotifyPropertyChanged("IsYIncreaments");
                }
            }
     
            private bool _isSizeIncreaments;
            public bool IsSizeIncreaments
            {
                get { return _isSizeIncreaments; }
                set
                {
                    _isSizeIncreaments = value;
                    NotifyPropertyChanged("IsSizeIncreaments");
                }
            }
     
            #region Implementation of INotifyPropertyChanged
     
            public event PropertyChangedEventHandler PropertyChanged;
     
            private void NotifyPropertyChanged(String info)
            {
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs(info));
                }
            }
     
            #endregion
        }
     
        private void SetUpRadChart()
        {
            RadChart1.DefaultView.ChartTitle.Content = "Server Load";
            RadChart1.DefaultView.ChartArea.NoDataString = "Waiting for data...";
            RadChart1.DefaultView.ChartArea.EnableAnimations = false;
        }
     
        private void SetUpTimer()
        {
            DispatcherTimer timer1 = new DispatcherTimer();
            timer1.Interval = TimeSpan.FromMilliseconds(_interval);
            timer1.Tick += timer1_Tick;
            timer1.Start();
     
            DispatcherTimer timer2 = new DispatcherTimer();
            timer2.Interval = TimeSpan.FromMilliseconds(1000);
            timer2.Tick += timer2_Tick;
            timer2.Start();
        }
     
        private void timer2_Tick(object sender, EventArgs e)
        {
            _frames.Add(_frame);
            if(5 < _frames.Count)
            {
                _frames.RemoveAt(0);
            }
            double fps = 0;
            foreach(int f in _frames)
            {
                fps += f;
            }
     
            fps = fps/_frames.Count;
            System.Diagnostics.Debug.WriteLine("FPS: " + fps + " time: " + DateTime.Now.ToLongTimeString());
            _frame = 0;
        }
     
        private void SetUpMapping()
        {
            SeriesMapping memoryDataMapping = new SeriesMapping();
            memoryDataMapping.LegendLabel = "Bubbles";
            memoryDataMapping.SeriesDefinition = new BubbleSeriesDefinition();
            memoryDataMapping.SeriesDefinition.AxisName = "Bubble Size";
            memoryDataMapping.ItemMappings.Add(new ItemMapping("X", DataPointMember.XValue));
            memoryDataMapping.ItemMappings.Add(new ItemMapping("Y", DataPointMember.YValue));
            memoryDataMapping.ItemMappings.Add(new ItemMapping("Size", DataPointMember.BubbleSize));
            RadChart1.SeriesMappings.Add(memoryDataMapping);
        }
     
        private void SetUpXAxis()
        {
            RadChart1.DefaultView.ChartArea.AxisX.DefaultLabelFormat = "#VAL";
            RadChart1.DefaultView.ChartArea.AxisX.LabelRotationAngle = 90;
            RadChart1.DefaultView.ChartArea.AxisX.LabelStep = 2;
            RadChart1.DefaultView.ChartArea.AxisX.Title = "X";
            RadChart1.DefaultView.ChartArea.AxisX.LayoutMode = AxisLayoutMode.Normal;
            RadChart1.DefaultView.ChartArea.AxisX.AutoRange = false;
        }
     
        private void SetUpYAxis()
        {
            RadChart1.DefaultView.ChartArea.AxisY.AutoRange = false;
            RadChart1.DefaultView.ChartArea.AxisY.MinValue = -50;
            RadChart1.DefaultView.ChartArea.AxisY.MaxValue = 150;
            RadChart1.DefaultView.ChartArea.AxisY.Step = 10;
            RadChart1.DefaultView.ChartArea.AxisY.DefaultLabelFormat = "#VAL";
            RadChart1.DefaultView.ChartArea.AxisY.Title = "Y";
        }
     
        private void SetUpAxisXRange()
        {
            RadChart1.DefaultView.ChartArea.AxisX.MinValue = -50;
            RadChart1.DefaultView.ChartArea.AxisX.MaxValue = 150;
            RadChart1.DefaultView.ChartArea.AxisX.Step = 10;
        }
     
        void timer1_Tick(object sender, EventArgs e)
        {
            _frame++;
            UpdateData();
            RadChart1.ItemsSource = null;
            RadChart1.ItemsSource = _data;
        }
    }


  6. Ves
    Admin
    Ves avatar
    2927 posts

    Posted 28 Oct 2010 Link to this post

    Hi Alexey Oyun,

    I must confirm this -- I was able to reproduce the issue, there seems to be a regression. I have forwarded your project to our developers for further investigation. Please, accept our apologies for the inconvenience caused.

    Kind regards,
    Ves
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top