Ticket #4886 (closed: fixed)

Opened 9 years ago

Last modified 5 years ago

Memory leak with MaskDetectors when giving a MaskedWorkspace

Reported by: Martyn Gigg Owned by: Martyn Gigg
Priority: critical Milestone: Release 2.1
Component: Mantid Keywords:
Cc: Blocked By:
Blocking: Tester: Roman Tolchenov

Description

When using MaskDetectors with a MaskedWorkspace there seems to be sizeable memory leak. The script below will end up consuming over 6 Gb of memory even though a MARI workspace is a few hundred Mb. Commenting out the MaskDetectors line brings the memory udner control.

This is causing the system tests to fail on Windows at the moment.

raw = LoadRaw('MAR11060.raw')
white_int = Integration(raw)

tiny = 0.01
large = 50000.

#banks = [(1,17280),(17281,18432),(18433,32256),(32257,41472)]
banks = [(1,230),(231,460),(461,690),(691,922)]

for i in range(5):
	for bank in banks:
		start_index = bank[0] - 1
		end_index = bank[1] - 1
		white_masks, num_failed = FindDetectorsOutsideLimits(white_int, StartWorkspaceIndex=start_index,
										  EndWorkspaceIndex=end_index,
									          HighThreshold=large, LowThreshold=tiny)
		MaskDetectors(white_int,MaskedWorkspace=white_masks,StartWorkspaceIndex=start_index,EndworkspaceIndex=end_index)

Change History

comment:1 Changed 9 years ago by Martyn Gigg

  • Status changed from new to accepted

comment:2 Changed 9 years ago by Martyn Gigg

Refs #4886. Workspace history only keeps unique algorithms.

The leak was due to the workspace history exponentially increasing in size. This history was duplicated with each run and then one algorithm added. The history is now in a set and only those algorithms that have not been run before are added.

Changeset: 460038485fdff1342ccc944e15857b0a80f13799

comment:3 Changed 9 years ago by Martyn Gigg

Refs #4886. Missed an include.

Changeset: 64dafdf1692240105618ac9c004af37d640b20ff

comment:4 Changed 9 years ago by Martyn Gigg

  • Status changed from accepted to verify
  • Resolution set to fixed

comment:5 Changed 8 years ago by Roman Tolchenov

  • Status changed from verify to verifying
  • Tester set to Roman Tolchenov

comment:6 Changed 8 years ago by Roman Tolchenov

  • Status changed from verifying to closed

Ran the script, didn't see any increase in memory.

comment:7 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 5732

Note: See TracTickets for help on using tickets.