tomviz
tomviz copied to clipboard
simple.SaveScreenshot() Memory Leak
Describe the bug Repeated use of the paraview.simple.SaveScreenshot() function leads to an increase in memory usage which will overtime slow down TomViz functionality.
To Reproduce Steps to reproduce the behavior:
- Load Default Dataset
- Open Python Console
- Write "from paraview import simple"
- Run "simple.SaveScreenshot('file.png', ImageResolution=(819,455)) repeatedly
Expected behavior Memory usage in the computer will increase over time and will not lower unless a previous state is loaded.
Desktop (please complete the following information):
- Operating system: Windows 10
- Tomviz version: 1.6.0
Hardware (please complete the following information):
- Device: Dell XPS 15"
- Graphics card: Nvidia GeForce GTX 1050
Additional context My issue stems from that fact I need to make an orbiting animation and take 45 images from different spots each frame hence why I can't use the built-in animation feature. It initially runs through 12 frames a minute, then 9 frames a minute, then less and less until it's less than 1 frame a minute. I have not fully measured this.
I didn't realize that worked, I will try and take a look at this, but it isn't something we have been testing internally. We didn't remove the paraview.simple module, but it will not see our pipeline and other pieces. We do have plans to add in some singleton objects to access equivalent functionality, but have not started that development yet.
Out of curiosity, what code is used for the "Export Screenshot" option under "File"? I can't find anything under VTK's documentation about screenshot saving, so I'm not sure what TomViz uses instead of the simple module.
It uses the C++ ParaView proxy API, you can see in https://github.com/OpenChemistry/tomviz/blob/master/tomviz/SaveScreenshotReaction.cxx all the steps taken. I think we should expose some simple Python API but this has not previously been a focus. Underneath I would expect paraview.simple to be doing similar things.