Im trying to find a acceptable way to warn a user that adding a filter may cause his server node to go out of memory.
Of course, it is out of the question to try to precompute the memory usage before pressing Apply, but I think we can still provide some tools to go in this direction.
I’m imagining a new XML hints to add to certain filters that we may consider impactful in terms of memory (especially filters converting from structured grid to unstructured grid).
Here is the synstax I envision:
<WarnOnCreation> <Conditions> <InputDataType> <DataType value="vtkRectilinearGrid" /> <DataType value="vtkImageData" /> </InputDataType> <MemoryUsage relative=10 absolute=30> </Conditions> <Text> Watch out, ParaView may explode </Text> </WarnOnCreation>
The conditions are AND,
The InputDataType let you specify for which dataset type in input to warn, OR
The memory usage can be used in two ways,
relative, where the provided number is a threshold in
%, if the
input size / remaining memory is >, then it warn.
absoulte, where the provided number is a threshold in
%, if the
remaining memory / available memory is <, then it warn.
The text is of course the text shown in the warning, but we could consider having a default for it.
The warning will be similar to the Volume Rendering warnings, where the user can decide to never see that warning again (for this specific filter).
This will not be bullet proof of course, we may warn when it is not needed and we may not warn before running out of memory, but this would still be an improvement imo.