mantidproject / mslice

Source code for Mantid MSlice
http://mantidproject.github.io/mslice
1 stars 2 forks source link

Running out of memory due to too many (hidden) temporary workspaces #924

Closed mducle closed 9 months ago

mducle commented 1 year ago

Describe the bug

MSlice produces alot of Mantid hidden __MSL<name> workspaces in the Mantid ADS in order to allow the history tracking facility for the script generation to work. In principle when the MSlice workspace is deleted or goes out of scope, the corresponding Mantid .raw_ws should be removed from the ADS and then garbage collected by Python. This does not seem to happen which means that a lot of these workspaces accumulate. Over a long session (during an experiment) eventually there were enough of these orphaned ADS hidden workspaces to cause the VM to (nearly) run out of memory.

To Reproduce

  1. Load a workspace and go to the "Cut" tab. Put in any value for the cut parameters and click "Plot".
  2. Click "Plot" again, and again, for several times.
  3. Check the "MDHisto" tab that several cut workspaces have been created with _(n) suffixes where n is an increasing index.
  4. Delete all the workspaces in the "MDHisto" tab.
  5. Go to Mantid Workbench and in the "Settings" menu, check "Show Invisible Workspaces".
  6. Verify that all the hidden workspaces are still in the ADS.

Expected behavior

Workspaces deleted from MSlice should also have their backing Mantid .raw_ws removed from the ADS so they can be garbage collected by Python.

Screenshots

N/A

MSlice Version (please complete the following information):

Additional context

N/A