-
Patrick Avery authored
When the program is allocating a huge chunk of memory to use, some operating systems will just kill the program instead of throwing std::bad_alloc. We don't want ParaView to be killed, so let's preemptively avoid using too much memory in the quadric clustering. This also avoids integer overflows that have occurred when the three integer divisions get multiplied together in vtkQuadricClustering. We are currently limiting the product of the three divisions to 1e8, which used up more than 10 GB of memory in the quadric clustering in my tests. We can potentially make this max product an option in the future. Signed-off-by: Patrick Avery <patrick.avery@kitware.com>