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

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Nathan
Newbie
Newbie
Posts: 4
Joined: Fri Jan 31, 2020 12:00 am

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

Post by Nathan » Thu Feb 06, 2020 5:07 am

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);

Marc
Site Admin
Site Admin
Posts: 1272
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

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

Post by Marc » Thu Feb 06, 2020 9:03 am

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
Steema Support

Marc
Site Admin
Site Admin
Posts: 1272
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

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

Post by Marc » Thu Feb 06, 2020 9:09 am

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

Nathan
Newbie
Newbie
Posts: 4
Joined: Fri Jan 31, 2020 12:00 am

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

Post by Nathan » Fri Feb 07, 2020 12:44 am

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

Post Reply