Page 1 of 1

OutOfMemory exception with nearly identical Y values (could be related to Bug 2267)

Posted: Thu Feb 06, 2020 5:07 am
by 16488027
These values came up in my application and still cause a crash. I extracted the data from the application and built a simple test project and it still crashs with an out of memory exception.

Series1->AddXY(7217900,282842.7);
Series1->AddXY(7218100,282842.7);
Series1->AddXY(7218300,282842.7);
Series1->AddXY(7218500,282842.7);
Series1->AddXY(7218700,282842.7);
Series1->AddXY(7218900,282842.7);
Series1->AddXY(7219100,282842.7);
Series1->AddXY(7219300,282842.7);
Series1->AddXY(7219500,282842.700000000064);
Series1->AddXY(7219700,282842.700000000064);
Series1->AddXY(7219900,282842.700000000064);
Series1->AddXY(7220100,282842.700000000064);
Series1->AddXY(7220300,282842.700000000064);
Series1->AddXY(7220500,282842.700000000064);
Series1->AddXY(7220700,282842.700000000064);

Re: OutOfMemory exception with nearly identical Y values (could be related to Bug 2267)

Posted: Thu Feb 06, 2020 9:03 am
by Marc
Hello,

Yes, this is, I think, related to precision of the double type itself. The problem of a large number with a small fraction.

For example this fails to find a correct Axis increment:

Code: Select all

  Series1.AddXY(7219300,282842.700000000032);
  Series1.AddXY(7219500,282842.700000000064);
But this is ok (with the same decimal precision):

Code: Select all

  Series1.AddXY(7219300,2842.700000000032);
  Series1.AddXY(7219500,2842.700000000064);
we'll have a think what can help resolve this.

Regards,
Marc Meumann

Re: OutOfMemory exception with nearly identical Y values (could be related to Bug 2267)

Posted: Thu Feb 06, 2020 9:09 am
by Marc
There is an interesting solution to the limitation, offered by Yeray for the ActiveX version of TeeChart:

viewtopic.php?f=1&t=17056&p=75804&hilit ... ion#p75804

Re: OutOfMemory exception with nearly identical Y values (could be related to Bug 2267)

Posted: Fri Feb 07, 2020 12:44 am
by 16488027
Thanks Marc.
Yes I would appreciate what you can come up with, as I think in any case the Steema module should not throw an out of exception. Yes you are right with the number representation. Interestingly, it seems to only be if ALL the numbers in the series are very close. If one point is added that is not a near identical value, then it doesn't crash.
Thanks for your feedback