Pre loader

memory usage

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
0

I have about 250 series. Each serie contains > 500000 points. I see that the memoryusage grows alot until the program crashes. Is there a way to use that many series with >1000000 points and keep the memory usage low? Im using a FifoChart. And i have a pc with enough RAM.

  • You must to post comments
1
0

Hi Bochelie,

Have a search of our knowledge base on OutOfMemoryException. You will see that it is possible to get an OutOfMemoryException when you have plenty of RAM, due to .NET4.5’s AnyCPU ‘Prefer 32-bit’ flag. Turning this off can solve many issues.

Next, 250 series with 500k points of double-double data requires at least 500000 * 250 * 8 * 2 = 2,000,000,000 bytes. Not excessive. However, note that FIFO Series require double the memory of standard XyDataSeries.

This is because the FIFO Buffer is circular, implemented as two pointers with Start/End indices. When we iterate over the FIFO Series, it is much faster to perform a memcopy to a cached array of size N than to resolve the circular index for each point. So now you need at least 4,000,000,000 bytes. This is not accounting for heap fragmentation, which can leave vast blocks of your managed heap unusable.

If you have way more than 8GB RAM and you are using .NET4.0 or 4.5 with ‘Prefer 32-bit’ false and still getting the issue, let me know.

Best regards,
Andrew

  • bochelie
    Im using .Net 4.0 but with VS2010. So thats not the case. I also have 4GB RAM. Maybe i should change my fifo series to standard XyDataSeries?
  • Andrew Burnett-Thompson
    So, you don't have enough RAM. Solution: buy more RAM! :)
  • bochelie
    Hahaha. I dont exactly know how to calculate the amount of memory needed. However i was wondering if i could resolve the issue in an elegant manner. Without buying more RAM :) I am thinking of switching between fifo and XyDataSeries depending on my needs. Is this a solution you think? I dont want to put a lot of effort into something that is not going to work.
  • Andrew Burnett-Thompson
    You could do this yes. XyDataSeries uses half the memory in non-FIFO mode than in FIFO mode. However, you're going to hit a ceiling anyway before physical memory is exhausted because of heap fragmentation and other system memory requirements. I wasn't joking about the more RAM solution! You could spend days getting this right (multiplied by your hourly rate), whereas a RAM upgrade could cost less than $100. If its plain not possible to upgrade the RAM (because you are on work computers), then I would suggest speaking to your managers about scaling back the amount of data you show on-screen.
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

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

Start TrialCase Studies