Pre loader

Tag: GC

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

1 vote

SciChart is creating too much garbage objects/events* instead of reusing through pools (Analysis through dotMemory shows this). In complex applications this additional gc-pressure causes frequent lockups. (GC Pauses in 50-250ms+ range).

Top backtraces for GC-Problem:
– WeakEventTable.Purge
– Tick Rendering (TimeSpan, Strings)
– ProperyChangedEventManager.Purge

Top Types:
– WeakEventTable+EventKey
– HybridDictionary
– Double, String, TimeSpan
– Action

All of these top types/backtraces result directly from SciChart as we cross-verified with your 2D-Chart-Realtime-Series demo and by omitting the SciChart controls from our application. ( 2/3 of the total memory pressure comes from SciChart with even just 2 charts being present in our application, we see 5MB garbage memory traffic per 2 second, resulting in very frequent GC collections sporadically spiking into a high duration)

We currently use SciChart WPF V5, it seems SciChart WPF V6 Demo didnt fix this instead just using the LowLatency GC mode causing more frequent GC-collections causing worse overall performance in complex applications. (as we verfied in our application)

Is there plans to increase memory/object reuse/pooling and reduce events/actions? (70k allocations of events/actions for short time spans arent really understandable). What are those 70k events for simply rendering a chart with not much changing, see the attached image.

What settings/methods do you recommend to lower the Memory Pressure/WeakEvents resulting from SciChart usage?

What is the best rendering method to minimize GC pressure, we only require updates if new data becomes available through our application. Would it be manual?

Please comment

Thank you

0 votes

Hello is there way to update points in XyDataSeries without Garbage Collector call? Here is my code:

public void RefreshSignal(float[] xData, float[] yData)
        if (_series == null)
             _series = new XyDataSeries<float, float>();
            _series.Append(xData, yData);

         for (int i = 0; i < xData.Length; i++)
               _series.Update(xData[i], yData[i]);

I may use _series.YValues[i], but then UI will not update.

Main task for me fast update all 25k points in series each 30ms without GC calls.

0 votes

To avoid arrays in LOH the UniformHeatmapDataSeries should use IList[] or Span instead of TZ[,].

  • Tobias asked 5 years ago
  • last active 5 years ago
0 votes

In my application I remove lines from SciChartSurface, but Resharper still shows that data not removed from memory.
How completely remove from memory, that GC would collect it?


I found smth strange, don’t even know if it’s my issue or not.
The structure shows what keeps my data alive.

using (sciChart.SuspendUpdates())
                    for (var i = 0; i < pavadinimai.Count; i++)
                        if (pavadinimai[i] != null)
                            this.Dispatcher.Invoke((Action)(() =>
                                var sarasas = new List<Duomenys>(LinijuSarasas);
                                var line = sarasas.SingleOrDefault(p => p.Linija.Name == pavadinimai[i]);
                                        string pavadin = pavadinimai[i];
                                        var Ynauj = Ynauji[i].Select(p => (double)p).ToList();
                                        line.XyAsiesTaskai.Append(Xnauji, Ynauj);
                                catch (Exception e)


var asis = asiesNr.ToString();
            using (sciChart.SuspendUpdates())
                for (var i = 0; i < YdtSeries.Count; i++)
                    if (pavadinimai[i] != null)
                        var dataSeries = MasyvasIXySeries(XdtSeries, YdtSeries[i], pavadinimai[i]);
                        var rnd = new Random().Next(0, 10);
                        var Fast = new FastLineRenderableSeries() { SeriesColor = spalvuMasyvas[i], DataSeries = dataSeries, Name = pavadinimai[i], YAxisId = asis, StrokeThickness = 1 };
                        PridetiLinijaPrieSaraso(dataSeries, asiesNr, asis, Fast, true, false);
Showing 4 results

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies