vtkFeatureEdges is allocating a very large array
It seems that since release 9.1 the
vtkFeatureEdges filter is allocating (or trying to) a very large array.
The following code:
from vtkmodules.vtkFiltersCore import vtkFeatureEdges from vtkmodules.vtkFiltersSources import vtkSphereSource N_CELLS = 2_000_000 source = vtkSphereSource() source.LatLongTessellationOn() source.SetEndPhi(90) source.SetThetaResolution(1000) source.SetPhiResolution(N_CELLS // 1000 + 1) source.Update() print("Cell count:", source.GetOutput().GetNumberOfCells()) feature_edges = vtkFeatureEdges() feature_edges.ExtractAllEdgeTypesOff() feature_edges.ColoringOff() feature_edges.BoundaryEdgesOn() feature_edges.SetInputConnection(source.GetOutputPort()) feature_edges.Update() print("Boundary edges:", feature_edges.GetOutput().GetNumberOfCells())
crashes on my system with the following output:
Cell count: 2000000 2021-12-21 12:32:13.692 ( 0.321s) [ ]vtkGenericDataArray.txx:389 ERR| vtkTypeInt64Array (0000029BB68DAD10): Unable to allocate 20000000000 elements of size 8 bytes.
that is, it appears (in this case) to try to allocate 10 thousand 8-byte elements for each cell in the mesh.