Ticket #7506 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

Memory leak in CalibrateRectangularDetectors

Reported by: Wenduo Zhou Owned by: Wenduo Zhou
Priority: blocker Milestone: Release 2.6
Component: Diffraction Keywords:
Cc: petersonpf@…, taylorrj@… Blocked By:
Blocking: Tester: Russell Taylor

Description

As running the python algorithm CalibrateRectangularDetectors, memory leak is observed. Using mantid's "File"->"Clear All Memory" does not release much memory either.

Script is as

CalibrateRectangularDetectors(Instrument="PG3", RunNumber = 13428, Extension = event.nxs", CompressOnRead = False, SmoothSummedOffsets = False, MaxOffset = 0.1, CrossCorrelation = False, PeakPositions = "0.4093, 0.4120, 0.4205, 0.4327, 0.4359, 0.4460, 0.4645, 0.4768, 0.4996, 0.5148, 0.5439,0.5640, 0.6029,.6305,.6864,.7280,.8182,.8916,1.0754,1.2610,2.0592", PeakWindowMax = 0.1, PeakFunction = "Gaussian", BackgroundType = "Linear", Binning = ".40, -.0004, 2.1", GroupDetectorsBy = "Group", FilterBadPulses = True, SaveAs = "calibration", OutputDirectory = "/tmp/")

Change History

comment:1 Changed 7 years ago by Peter Peterson

  • Status changed from new to inprogress

Re #7506. Checkpointing small bits of code cleanup.

Changeset: dc27fc8e6ccf11ae584e710c803640be9a2b1571

comment:2 Changed 7 years ago by Wenduo Zhou

Checkpointing work. Refs #7506.

Changeset: aaeec8343f0e254810674bf6e41c78c37b1d4cb8

comment:3 Changed 7 years ago by Wenduo Zhou

Checkpointing work. Refs #7506.

Changeset: 56a273d3cb180759ab1f1be977e64912421b1e67

comment:4 Changed 7 years ago by Nick Draper

  • Component changed from Framework to Diffraction

Wenduo,

This ticket has not been updated today, and you did not send me a progress report when asked.

If I do not hear from you why this ticket should delay the release and how much longer it is going to take then I’ll move it to release 3.0 when I get into work Tuesday morning.

comment:5 Changed 7 years ago by Wenduo Zhou

Fixed the memory leak. Refs #7506.

Memory leak is caused by mistakenly using ws.dataX(spectrum), which causes a copy operatoin on vector, other than ws.readX(spectrum). As it is not threading safe, the memory leak occurs.

Changeset: 567c58d0be0adc094312403a5388e2355a1fed82

comment:6 Changed 7 years ago by Wenduo Zhou

Fixed the inconsistency in unit test. Refs #7506.

Changeset: 4cd8c6dc5710d1ebe0648b898e3a6bf6546dfa3b

comment:7 Changed 7 years ago by Wenduo Zhou

Revert some change. Refs #7506_calibrate_mem_leak.

Changeset: 52bbaaba60e47548c00b95102501e8dc02c82b25

comment:8 Changed 7 years ago by Wenduo Zhou

Fixed the memory leak. Refs #7506.

Memory leak is caused by mistakenly using ws.dataX(spectrum), which causes a copy operatoin on vector, other than ws.readX(spectrum). As it is not threading safe, the memory leak occurs.

Changeset: 5fd0e176fed6f3f2e5d1ab65c13b178dc4c2c926

comment:9 Changed 7 years ago by Wenduo Zhou

Fixed a possible memory error. Refs #7506.

Changeset: 3ab7e48924c9476ad4abd49b6dbb6491e7b9d039

comment:10 Changed 7 years ago by Wenduo Zhou

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

How to verify

Re-run the script, which is described in the ticket such that the memory leak can be observed.

CalibrateRectangularDetectors(Instrument="PG3", RunNumber = 13428, Extension = event.nxs", CompressOnRead = False, SmoothSummedOffsets = False, MaxOffset = 0.1, CrossCorrelation = False, PeakPositions = "0.4093, 0.4120, 0.4205, 0.4327, 0.4359, 0.4460, 0.4645, 0.4768, 0.4996, 0.5148, 0.5439,0.5640, 0.6029,.6305,.6864,.7280,.8182,.8916,1.0754,1.2610,2.0592", PeakWindowMax = 0.1, PeakFunction = "Gaussian", BackgroundType = "Linear", Binning = ".40, -.0004, 2.1", GroupDetectorsBy = "Group", FilterBadPulses = True, SaveAs = "calibration", OutputDirectory = "/tmp/")

You can see that the problem reported should not occur anymore.

comment:11 Changed 7 years ago by Nick Draper

Sorry we don't have that file at ISIS, can this be tested at ORNL?

comment:12 Changed 7 years ago by Russell Taylor

  • Status changed from verify to verifying
  • Tester set to Russell Taylor

comment:13 Changed 7 years ago by Wenduo Zhou

Correct a spelling error. Refs #7506.

Changeset: 44688b8851ce0903c828da420ccac58b5fcad81e

comment:14 Changed 7 years ago by Russell Taylor

  • Status changed from verifying to closed

BIG decrease in memory use from the critical change here.

comment:15 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 8351

Note: See TracTickets for help on using tickets.