Closed swederik closed 1 year ago
This is a pretty bad issue. We have no ability to remove a volume from the cache.
https://github.com/OHIF/Viewers/blob/24a8d7bca2e8daa119da324fc46595418013892e/extensions/ohif-vtk-extension/src/OHIFVTKViewport.js#L36-L37
Similarly, we have the image data cache which is also never cleared (and is stored in react-vtkjs-viewport library):
https://github.com/OHIF/react-vtkjs-viewport/blob/3b48f4a7141b3e95353d5d1649e2c2af5f579ecd/src/lib/getImageData.js#L8-L15
We need to unify this stuff somewhere. We also need to add some ability to know when we are no longer displaying a volume anywhere so we can decache it. I've added an onDestroyed function prop here (https://github.com/OHIF/react-vtkjs-viewport/blob/master/src/VTKViewport/View2D.js#L82) but it isn't used anywhere yet.
@jbocce Can you validate this if still happens? and close if not valid anymore
After calling cornerstone.cache.purgeCache(), the heap snapshot is significantly less.
This is a pretty bad issue. We have no ability to remove a volume from the cache.
https://github.com/OHIF/Viewers/blob/24a8d7bca2e8daa119da324fc46595418013892e/extensions/ohif-vtk-extension/src/OHIFVTKViewport.js#L36-L37
Similarly, we have the image data cache which is also never cleared (and is stored in react-vtkjs-viewport library):
https://github.com/OHIF/react-vtkjs-viewport/blob/3b48f4a7141b3e95353d5d1649e2c2af5f579ecd/src/lib/getImageData.js#L8-L15
We need to unify this stuff somewhere. We also need to add some ability to know when we are no longer displaying a volume anywhere so we can decache it. I've added an onDestroyed function prop here (https://github.com/OHIF/react-vtkjs-viewport/blob/master/src/VTKViewport/View2D.js#L82) but it isn't used anywhere yet.