Ticket #8053 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

Investigate possible memory leak from unreleased use of poco XML document and node lists.

Reported by: Alex Buts Owned by: Karl Palmen
Priority: major Milestone: Release 3.1
Component: Framework Keywords: maintenance
Cc: owen.arnold@… Blocked By:
Blocking: #10637 Tester: Gesner Passos

Description (last modified by Karl Palmen) (diff)

It was noticed during the work on unrelated ticket #6447, that there is possible memory leak in the Box controller code transforming BC to/from xml. This has been found not to be the case, but similar have been found elsewhere in the code.

Possible memory leaks arising from non-release of Poco::XM::document and any node list extracted from it should be investigated and fixed if identified.

Change History

comment:1 Changed 7 years ago by Karl Palmen

Investigation has shown that because the code of BoxController uses a Poco::AutoPtr. The release is not necessary, but it has been ound to be necessary, but is found to be necessary in other parts of the code such as InstrumentDefinitionParser, which uses bare Poco::Document pointers and these do require the release calls. So I extend this ticket to include such cases.

comment:2 Changed 7 years ago by Karl Palmen

  • Keywords maintenance added
  • Milestone changed from Release 3.0 to Backlog
  • Description modified (diff)
  • Summary changed from Investigate possible memory leak in Box controller. to Investigate possible memory leak from unreleased use of poco XML document and node lists.

comment:3 Changed 7 years ago by Karl Palmen

  • Milestone changed from Backlog to Release 3.1

comment:4 Changed 7 years ago by Karl Palmen

  • Status changed from new to inprogress

comment:5 Changed 7 years ago by Karl Palmen

If find the following include 'Poco::XML'

API

ImplicitFunctionFactory, ImplicitFunctionParameter, ImplicitFunctionParameterParser, ImplicitFunctionParameterParserFactory, ImplicitFunctionParser, ImplicitFunctionParserFactory and some unit tests thereof

SingleValueParameterParser, VectorParameterParser, VectorParameterTest

BoxController, ExperimentInfo

Algorithms CreateDummyCalFile, ReadGroupsFromFile, DetectorEfficiencyCorTest

MantidQT/CustomInterfaces IO_MuonGrouping

DataHandling ConvertFullprofToXML, LoadCanSAS1D, LoadCanSAS1D2, LoadDetectorsGroupingFile, LoadMask, LoadSpice2D, FindDetectorsInShape, GenerateGroupingPowder, LoadInstrument, LoadParameterFile, LoadPreNexus, LoadPreNexusMonitors, SaveDetectorsGrouping, SNSDataArchive, ConvertFullprofToXMLTest

Geometry Component, ComponentParser, IMDDimensionFactory, InstrumentDefinitionParser, ShapeFactory, vtkGeometryCacheReader, CompositeImplicitFunction, MDGeometryXMLBuilder, MDGeometryXMLParser, MDHistoDimension, MDPlaneImplicitFunction and unit tests for some of them.

Kernel CalalogInfo, FacilityInfo, InstrumentInfo, RemoteJobManager, XMLInstantiator, ConfigService and some unit tests for them

LiveData SNSLiveEventDataListener, ADARAPacketTest,

MDAlgorithms InvalidParameterParser, Vector3DParameterParser, BinMDTest, InvalidParameterParserTest

MDEvents AffineMatrixParameterParser, CoordTransformAffineParser, CoordTransformDistanceParser and unit tests

MantidQT/SliceViewer SliceViewer

SINQ SINQHMListener

comment:6 Changed 7 years ago by Karl Palmen

ImplicitFunctionParameterParserFactoryImpl::createImplicitFunctionParameterParserFromXML uses a NodeList* (ordinary pointer) without releasing it, as does ImplicitFunctionParserFactoryImpl::createImplicitFunctionParserFromXML

ImplicitFunctionFactoryImpl::createUnwrapped creates a Document* without releasing it.

comment:7 Changed 7 years ago by Karl Palmen

Most for the code listed uses Document* or NodeList* without calling the release fumnction. I did find a few exceptions.

Last edited 7 years ago by Karl Palmen (previous) (diff)

comment:8 Changed 7 years ago by Karl Palmen

The code in Geometry, Kernel and LiveData is generally better behaved.

comment:9 Changed 7 years ago by Karl Palmen

I've created tickets #8483 #8484 #8485 #8486 #8487 #8489 #8490 #8491 and #8492 to cover the unresolved cases in different areas of the code.

comment:10 Changed 7 years ago by Karl Palmen

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

To test check the tickets covering the oytstanding issues. Do not run git macros.

comment:11 Changed 7 years ago by Gesner Passos

  • Status changed from verify to verifying
  • Tester set to Gesner Passos

comment:12 Changed 7 years ago by Gesner Passos

  • Status changed from verifying to reopened
  • Resolution fixed deleted

I found that these files uses Poco xml as well:

Mantid/Vates/VatesAPI/src/vtkDataSetToWsLocation.cpp
Mantid/Vates/VatesAPI/src/vtkDataSetToWsName.cpp

Besides, the description of the tickets suggest to use release, but, prefer the AutoPtr, as it is the preferable way given by the documentation of Poco.

comment:13 Changed 7 years ago by Karl Palmen

  • Status changed from reopened to inprogress

comment:14 Changed 7 years ago by Karl Palmen

Tickets modified to request fixing by AutoPtr.

comment:15 Changed 7 years ago by Karl Palmen

Added ticket #8511 for VATES.

comment:16 Changed 7 years ago by Karl Palmen

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

comment:17 Changed 7 years ago by Gesner Passos

  • Status changed from verify to verifying

comment:18 Changed 7 years ago by Gesner Passos

  • Status changed from verifying to closed

Now, at least, we have tickets created for all the usages of xml poco library.

comment:19 Changed 6 years ago by Federico M Pouzols

  • Blocking 10637 added

comment:20 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 8898

Note: See TracTickets for help on using tickets.